@php $responseJson = json_encode( $agent->response ?? new \stdClass(), JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES, ); $definitionHasErrors = isset($errors) && ($errors->has('prompt') || $errors->has('response')); @endphp

Agent Prompt & Expected Response Stored on this Agent and returned by the Agents API View runs @if ($agent->registered_by === \App\Models\Agent::REG_N8N) View n8n execution logs @endif

Prompt{{ number_format(mb_strlen((string) $agent->prompt)) }} characters
@if (filled($agent->prompt))
{{ $agent->prompt }}
@else

No prompt has been registered for this Agent.

@endif
Expected ResponseJSON contract
@if ($agent->response !== null)
{{ $responseJson }}
@else

No expected response has been registered for this Agent.

@endif

These values are used by API consumers and future Agent runs. Existing run snapshots stay unchanged.

@csrf @method('PATCH') @if (isset($errors)) @error('prompt')

{{ $message }}

@enderror @endif @if (isset($errors)) @error('response')

{{ $message }}

@enderror @endif
Saving changes updates the values returned by the Agents API and used by future runs. A later n8n sync may replace them with the workflow definition.