> ## Documentation Index
> Fetch the complete documentation index at: https://docs.narrative.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Invalid Request Payload

> The workflow could not decode the run's request_payload JSONB into a known shape.

**Surface:** `GET /agents/runs/{id}`, `error.type = "AgentLoopInvalidRequestPayload"`

## When this error occurs

The workflow's load activity reads `agent_runs.request_payload` and expects one of:

* `{"kind": "user_message", "text": "..."}`
* `{"kind": "tool_outputs", "outputs": [...]}`

This error means the JSONB doesn't carry a recognised `kind` value or fails to decode the body
for the recognised kind. Most commonly: a payload that bypassed the API and was hand-inserted
into the database with an unexpected shape, or a future API version emitting a `kind` value
the workers don't recognise yet.

## How to fix

If the row was created through the API, this is a server-side schema-drift bug — file an
issue with the `log_id` and the run id. If the row was hand-seeded (e.g. via the
`AgentLoopStarter` test harness), check the payload JSON against the
`RunRequestPayload` shape.
