Get a run's prompt snapshot and final answer.
- Productionhttps://api.foxglove.dev/v1/automations/runs/{runId}
// No request payloadRun with its final answer
Whether Foxglove ran the automation to the end, separate from what the run found. finished means the agent's turn ended, or a limit stopped the run after the agent reported its result. blocked means a limit or a missing permission stopped the run before that, such as the AI usage limit, the run's time limit, or an owner who lost access to the project. error means the run failed on Foxglove's side.
What the agent reported the run accomplished. needs_review means the task finished but the agent was not sure whether something went wrong. no_result means the task ran and had nothing to act on, such as no matching data. Null when the agent did not report a result, for example because the run was blocked or failed before it finished.
Concrete model the run's chat used, such as claude-sonnet-5-5. Null until the run's chat exists.
The agent's final response: the last stretch of text, after any tool call before it, in the newest recent message that has text. For a failed run, set only when the run ended on that text. Null while the run is pending or running, when no recent message has text, or when the turn holding it was stopped or failed.
The trigger whose event started the run, or null when the run was started manually. Editing a trigger replaces it with a new one, so its event type and configuration are as they were when the run started. deletedAt is set once the trigger has been replaced or removed.
The recording, event, session, or device whose webhook event started the run, or null for manual and scheduled runs. Taken from the event saved with the run, so it names the item even after the item is deleted.
Token usage summed across model calls attached to the run's assistant messages, including tool-loop iterations and reported partial usage from failed calls. The buckets are disjoint; add all four for the total. Cache reads are input served from the prompt cache; cache writes combine 5-minute and 1-hour writes. Auxiliary calls without a message are excluded. Active runs report usage persisted so far. Null means no usage has been recorded, including runs that predate usage collection.
{ "id": "string", "automationId": "string", "actionPrompt": "string", "runPrompt": "string", "status": "pending", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "startedAt": "2019-08-24T14:15:22Z", "completedAt": "2019-08-24T14:15:22Z", "errorMessage": "string", "execution": "pending", "result": "succeeded", "resultSummary": "string", "model": "string", "automationName": "string", "finalAnswer": "string", "trigger": { "id": "string", "automationId": "string", "eventType": "recording.created", "enabled": true, "configurationVersion": 1, "configuration": { … }, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "deletedAt": "2019-08-24T14:15:22Z" }, "triggerSource": { "kind": "recording", "id": "string", "projectId": "string", "available": true }, "tokenUsage": { "inputTokens": 0, "outputTokens": 0, "cacheReadTokens": 0, "cacheWriteTokens": 0 } }