API

AgentWorkflowRun

Operations

Every route this entity exposes. Each route links to its own reference on this page.

Method Route SDK operation Returns
POST /api/v1/organizations/{organization_id}/agents/{id}/spark/workflow_runs/{run_id}/answer create The reopened run, whose stopped step the agent's worker runs again with the answer
POST /api/v1/organizations/{organization_id}/agents/{id}/spark/workflow_runs/{run_id}/approve create The reopened run, whose checkpoint the agent's worker answers with the decision; a decline ends the run
POST /api/v1/organizations/{organization_id}/agents/{id}/spark/workflow_runs/{run_id}/dismiss create The ended run; a run that worked in a thread made for it also has that thread archived
POST /api/v1/organizations/{organization_id}/agents/{id}/spark/workflow_runs/{run_id}/retry create The reopened run, which the agent's worker continues from its failed step
GET /api/v1/organizations/{organization_id}/agents/{id}/spark/workflow_runs list Recorded workflow runs, newest first
GET /api/v1/organizations/{organization_id}/agents/{id}/spark/workflow_runs/{run_id} load A recorded workflow run and its steps
GET /api/v1/organizations/{organization_id}/agents/{id}/spark/workflow_runs/summary load Each workflow's runs over the last 30 days

Examples

One example per SDK, generated from the API model. The argument names are the parameters and fields of this entity, and the values are placeholders. The examples are not compiled or executed.

Golang

Construct client as shown in the Golang setup, then call the operations:

agent_workflow_runs, err := client.AgentWorkflowRun(nil).List(map[string]any{"agent_id": "example", "organization_id": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(agent_workflow_runs)
agent_workflow_run, err := client.AgentWorkflowRun(nil).Load(map[string]any{"agent_id": "example", "id": "example_id", "organization_id": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(agent_workflow_run)

Lua

Construct client as shown in the Lua setup, then call the operations:

local agent_workflow_runs, err = client:AgentWorkflowRun():list({ agent_id = "example", organization_id = "example" })
local agent_workflow_run, err = client:AgentWorkflowRun():load({ agent_id = "example", id = "example_id", organization_id = "example" })

PHP

Construct client as shown in the PHP setup, then call the operations:

$agent_workflow_runs = $client->AgentWorkflowRun()->list(["agent_id" => "example", "organization_id" => "example"]);
$agent_workflow_run = $client->AgentWorkflowRun()->load(["agent_id" => "example", "id" => "example_id", "organization_id" => "example"]);

Python

Construct client as shown in the Python setup, then call the operations:

agent_workflow_runs = client.AgentWorkflowRun().list({"agent_id": "example", "organization_id": "example"})
agent_workflow_run = client.AgentWorkflowRun().load({"agent_id": "example", "id": "example_id", "organization_id": "example"})

Ruby

Construct client as shown in the Ruby setup, then call the operations:

agent_workflow_runs = client.AgentWorkflowRun.list({ "agent_id" => "example", "organization_id" => "example" })
agent_workflow_run = client.AgentWorkflowRun.load({ "agent_id" => "example", "id" => "example_id", "organization_id" => "example" })

TypeScript

Construct client as shown in the TypeScript setup, then call the operations:

const agent_workflow_runs = await client.AgentWorkflowRun().list({ agent_id: "example", organization_id: "example" })
const agent_workflow_run = await client.AgentWorkflowRun().load({ agent_id: "example", id: "example_id", organization_id: "example" })

Fields

Field Type Required Description
action string Yes Action
automation one,object,null No Saved native automation identity.
budget_seconds one,integer,null Yes The run stops once it has been running this long
budget_usd one,number,null Yes The run stops before a step once it has spent this much
can_answer boolean Yes Whether this viewer can answer the step that stopped the run; the answer runs that step again
can_approve boolean Yes Whether this viewer can approve or decline the checkpoint the run waits at; only a person can approve one
can_dismiss boolean Yes Whether this viewer can dismiss the run waiting for them, which ends it unanswered
checkpoint one,object,null Yes The question a run waiting at a checkpoint is asking
conversation_id one,string,null Yes The thread the run works in, which the person opens to follow it
decision_history object No Decision History
error one,string,null Yes Error
finished_at one,string,null Yes Finished At
flow_steps one,array,null Yes How the run went at each step of its workflow file, in the order it reached them; null when steps were recorded without their step of the file
id string Yes Public run ID.
needs_you boolean Yes Whether a step stopped the run for the person, who can answer it
note one,string,null Yes One sentence a workflow step left for the person, which the run's card leads with
nothing_to_do_reason one,string,null Yes Why a run that succeeded did no work, as the step that found nothing to do said; null otherwise.
resume_count integer Yes How many times the run went on from a checkpoint; it tells one pause from the next, even at the same checkpoint
retry_step_id one,string,null Yes Retry Step Id
running_seconds integer Yes How long the run has been running, not counting time waiting at a checkpoint or for a retry
source string Yes Source
spent_tokens integer Yes The tokens the run's agent steps have used so far
spent_usd number Yes What the run's agent steps have cost so far, as the agent reported it
stalled boolean Yes Whether a running run has had no sign of its worker for five minutes; it continues if the worker comes back
started_at string Yes Started At
started_by one,object,null Yes The event that started the run
status string Yes Status
step_count integer Yes Step Count
steps array Yes Steps
trigger_id one,string,null Yes The run settings that started it, for a run an event or schedule started
wake_at one,string,null Yes When a sleeping run's step looks again
workflow_digest one,string,null Yes SHA-256 of the immutable definition this run uses
workflow_path one,string,null Yes Workflow Path

create

POST /api/v1/organizations/{organization_id}/agents/{id}/spark/workflow_runs/{run_id}/answer

Operation ID: post_api_v1_organizations_organization_id_agents_id_spark_workflow_runs_run_id_answer.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
organization_id path string Yes
id path string Yes
run_id path string Yes

Request body

application/json

Property Type Required Description
answer string Yes The person's answer to the question the step stopped on
question_at string (date-time) Yes The run's finished_at when it stopped on the question being answered; a run since stopped on another question refuses the answer

Responses

200: The reopened run, whose stopped step the agent's worker runs again with the answer

application/json

Property Type Required Description
action enum: run, resume Yes
automation object No Saved native automation identity. Name is its current catalog name; version identifies the immutable definition this run uses. Null for legacy runs.
automation.id string Yes
automation.key string Yes
automation.name string Yes
automation.version integer Yes
automation.version_id string Yes
budget_seconds integer Yes The run stops once it has been running this long
budget_usd number Yes The run stops before a step once it has spent this much
can_answer boolean Yes Whether this viewer can answer the step that stopped the run; the answer runs that step again
can_approve boolean Yes Whether this viewer can approve or decline the checkpoint the run waits at; only a person can approve one
can_dismiss boolean Yes Whether this viewer can dismiss the run waiting for them, which ends it unanswered
checkpoint object Yes The question a run waiting at a checkpoint is asking
checkpoint.kind enum: approval, input Yes
checkpoint.preview string No The checkpoint evidence shown to the person, bounded to 16 KiB.
checkpoint.prompt string Yes
checkpoint.step_id string No The id of the workflow file's step the run waits at, when the worker could tell
conversation_id string,null Yes The thread the run works in, which the person opens to follow it
decision_history object No
decision_history.items array of object Yes
decision_history.items[].attempt integer Yes
decision_history.items[].attempted_at string (date-time) Yes
decision_history.items[].finished_at string (date-time) Yes
decision_history.items[].position integer Yes
decision_history.items[].questions array of object Yes
decision_history.items[].questions[].name string Yes
decision_history.items[].questions[].prompt string Yes
decision_history.items[].questions[].result object Yes
decision_history.items[].questions[].result.choice string No
decision_history.items[].questions[].result.confidence number No
decision_history.items[].questions[].result.decision string Yes
decision_history.items[].questions[].result.model string No
decision_history.items[].questions[].result.pass_at integer No
decision_history.items[].questions[].result.probabilities object No
decision_history.items[].questions[].result.probability number No
decision_history.items[].questions[].result.reason string No
decision_history.items[].questions[].result.score number No
decision_history.items[].questions[].result.source enum: jev, fallback Yes
decision_history.items[].questions[].result.threshold number No
decision_history.items[].questions[].result.type enum: noul, choice, score No
decision_history.items[].status enum: pending, running, completed, interrupted, not_started Yes
decision_history.items[].step_id string Yes
decision_history.items[].usage_confirmed boolean Yes
decision_history.pagination object Yes
decision_history.pagination.limit integer Yes
decision_history.pagination.next string No
error string Yes
finished_at string Yes
flow_steps array of object Yes How the run went at each step of its workflow file, in the order it reached them; null when steps were recorded without their step of the file
flow_steps[].definition_step_id string Yes
flow_steps[].status enum: succeeded, running, waiting, sleeping, failed Yes
id string Yes
needs_you boolean Yes Whether a step stopped the run for the person, who can answer it
note string Yes One sentence a workflow step left for the person, which the run's card leads with
nothing_to_do_reason string Yes Why a run that succeeded did no work, as the step that found nothing to do said; null otherwise.
resume_count integer Yes How many times the run went on from a checkpoint; it tells one pause from the next, even at the same checkpoint
retry_step_id string Yes
running_seconds integer Yes How long the run has been running, not counting time waiting at a checkpoint or for a retry
source enum: chat, event, schedule, manual Yes
spent_tokens integer Yes The tokens the run's agent steps have used so far
spent_usd number Yes What the run's agent steps have cost so far, as the agent reported it
stalled boolean Yes Whether a running run has had no sign of its worker for five minutes; it continues if the worker comes back
started_at string Yes
started_by object Yes The event that started the run
started_by.kind string Yes
started_by.reference string Yes
started_by.source string Yes
started_by.title string Yes
status enum: running, succeeded, blocked, sleeping, step_failed, failed, ... Yes
step_count integer Yes
steps array of object Yes
steps[].attempt integer Yes
steps[].command string Yes
steps[].conversation_id string Yes The conversation an agent step ran in, readable with the agent's conversation endpoint; null for command steps
steps[].definition_step_id string Yes The id of the workflow file's step this attempt ran for; null for steps recorded before workers reported it
steps[].error string Yes
steps[].exit_code integer Yes
steps[].finished_at string Yes
steps[].id string Yes
steps[].kind enum: agent, command, message, gate Yes
steps[].model string Yes
steps[].output_bytes integer Yes
steps[].output_preview string Yes
steps[].output_preview_complete boolean Yes
steps[].output_truncated boolean Yes
steps[].risk object Yes What an agent step asked for its risk said about its change
steps[].risk.level enum: obvious, not_obvious Yes
steps[].risk.reason string Yes
steps[].sequence integer Yes
steps[].started_at string Yes
steps[].status enum: running, succeeded, failed, interrupted Yes
steps[].stopped object Yes Why an agent step that answered blocked stopped for the person, and the note it left them
steps[].stopped.note string Yes
steps[].stopped.reason string Yes
steps[].summary string Yes
steps[].waited object Yes What an agent step that answered waiting is waiting for; the run sleeps and the step looks again later
steps[].waited.reason string Yes
trigger_id string Yes The run settings that started it, for a run an event or schedule started
wake_at string Yes When a sleeping run's step looks again
workflow_digest string Yes SHA-256 of the immutable definition this run uses
workflow_path string Yes
401: Unauthorized
403: Forbidden
404: Not found
409: The run is not waiting for an answer, or is waiting on a later question

application/json

Property Type Required Description
error string Yes
422: Unprocessable entity
502: Bad gateway

POST /api/v1/organizations/{organization_id}/agents/{id}/spark/workflow_runs/{run_id}/approve

Operation ID: post_api_v1_organizations_organization_id_agents_id_spark_workflow_runs_run_id_approve.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
organization_id path string Yes
id path string Yes
run_id path string Yes

Request body

application/json

Property Type Required Description
approved boolean Yes True to approve the checkpoint and go on, false to decline it and end the run
checkpoint object Yes The run's checkpoint as the person read it; a run since stopped at another checkpoint refuses the decision
checkpoint.kind enum: approval, input Yes
checkpoint.preview string No The checkpoint evidence shown to the person, bounded to 16 KiB.
checkpoint.prompt string Yes
checkpoint.step_id string No The id of the workflow file's step the run waits at, when the worker could tell
resume_count integer Yes The run's resume_count as the person read it; it names the pause the decision is for, so a later pause at the same checkpoint refuses it

Responses

200: The reopened run, whose checkpoint the agent's worker answers with the decision; a decline ends the run

application/json

Property Type Required Description
action enum: run, resume Yes
automation object No Saved native automation identity. Name is its current catalog name; version identifies the immutable definition this run uses. Null for legacy runs.
automation.id string Yes
automation.key string Yes
automation.name string Yes
automation.version integer Yes
automation.version_id string Yes
budget_seconds integer Yes The run stops once it has been running this long
budget_usd number Yes The run stops before a step once it has spent this much
can_answer boolean Yes Whether this viewer can answer the step that stopped the run; the answer runs that step again
can_approve boolean Yes Whether this viewer can approve or decline the checkpoint the run waits at; only a person can approve one
can_dismiss boolean Yes Whether this viewer can dismiss the run waiting for them, which ends it unanswered
checkpoint object Yes The question a run waiting at a checkpoint is asking
checkpoint.kind enum: approval, input Yes
checkpoint.preview string No The checkpoint evidence shown to the person, bounded to 16 KiB.
checkpoint.prompt string Yes
checkpoint.step_id string No The id of the workflow file's step the run waits at, when the worker could tell
conversation_id string,null Yes The thread the run works in, which the person opens to follow it
decision_history object No
decision_history.items array of object Yes
decision_history.items[].attempt integer Yes
decision_history.items[].attempted_at string (date-time) Yes
decision_history.items[].finished_at string (date-time) Yes
decision_history.items[].position integer Yes
decision_history.items[].questions array of object Yes
decision_history.items[].questions[].name string Yes
decision_history.items[].questions[].prompt string Yes
decision_history.items[].questions[].result object Yes
decision_history.items[].questions[].result.choice string No
decision_history.items[].questions[].result.confidence number No
decision_history.items[].questions[].result.decision string Yes
decision_history.items[].questions[].result.model string No
decision_history.items[].questions[].result.pass_at integer No
decision_history.items[].questions[].result.probabilities object No
decision_history.items[].questions[].result.probability number No
decision_history.items[].questions[].result.reason string No
decision_history.items[].questions[].result.score number No
decision_history.items[].questions[].result.source enum: jev, fallback Yes
decision_history.items[].questions[].result.threshold number No
decision_history.items[].questions[].result.type enum: noul, choice, score No
decision_history.items[].status enum: pending, running, completed, interrupted, not_started Yes
decision_history.items[].step_id string Yes
decision_history.items[].usage_confirmed boolean Yes
decision_history.pagination object Yes
decision_history.pagination.limit integer Yes
decision_history.pagination.next string No
error string Yes
finished_at string Yes
flow_steps array of object Yes How the run went at each step of its workflow file, in the order it reached them; null when steps were recorded without their step of the file
flow_steps[].definition_step_id string Yes
flow_steps[].status enum: succeeded, running, waiting, sleeping, failed Yes
id string Yes
needs_you boolean Yes Whether a step stopped the run for the person, who can answer it
note string Yes One sentence a workflow step left for the person, which the run's card leads with
nothing_to_do_reason string Yes Why a run that succeeded did no work, as the step that found nothing to do said; null otherwise.
resume_count integer Yes How many times the run went on from a checkpoint; it tells one pause from the next, even at the same checkpoint
retry_step_id string Yes
running_seconds integer Yes How long the run has been running, not counting time waiting at a checkpoint or for a retry
source enum: chat, event, schedule, manual Yes
spent_tokens integer Yes The tokens the run's agent steps have used so far
spent_usd number Yes What the run's agent steps have cost so far, as the agent reported it
stalled boolean Yes Whether a running run has had no sign of its worker for five minutes; it continues if the worker comes back
started_at string Yes
started_by object Yes The event that started the run
started_by.kind string Yes
started_by.reference string Yes
started_by.source string Yes
started_by.title string Yes
status enum: running, succeeded, blocked, sleeping, step_failed, failed, ... Yes
step_count integer Yes
steps array of object Yes
steps[].attempt integer Yes
steps[].command string Yes
steps[].conversation_id string Yes The conversation an agent step ran in, readable with the agent's conversation endpoint; null for command steps
steps[].definition_step_id string Yes The id of the workflow file's step this attempt ran for; null for steps recorded before workers reported it
steps[].error string Yes
steps[].exit_code integer Yes
steps[].finished_at string Yes
steps[].id string Yes
steps[].kind enum: agent, command, message, gate Yes
steps[].model string Yes
steps[].output_bytes integer Yes
steps[].output_preview string Yes
steps[].output_preview_complete boolean Yes
steps[].output_truncated boolean Yes
steps[].risk object Yes What an agent step asked for its risk said about its change
steps[].risk.level enum: obvious, not_obvious Yes
steps[].risk.reason string Yes
steps[].sequence integer Yes
steps[].started_at string Yes
steps[].status enum: running, succeeded, failed, interrupted Yes
steps[].stopped object Yes Why an agent step that answered blocked stopped for the person, and the note it left them
steps[].stopped.note string Yes
steps[].stopped.reason string Yes
steps[].summary string Yes
steps[].waited object Yes What an agent step that answered waiting is waiting for; the run sleeps and the step looks again later
steps[].waited.reason string Yes
trigger_id string Yes The run settings that started it, for a run an event or schedule started
wake_at string Yes When a sleeping run's step looks again
workflow_digest string Yes SHA-256 of the immutable definition this run uses
workflow_path string Yes
401: Unauthorized
403: Forbidden
404: Not found
409: The run is not waiting for approval, or is waiting at a later checkpoint than the one decided

application/json

Property Type Required Description
error string Yes
422: Unprocessable entity
502: Bad gateway

POST /api/v1/organizations/{organization_id}/agents/{id}/spark/workflow_runs/{run_id}/dismiss

Operation ID: post_api_v1_organizations_organization_id_agents_id_spark_workflow_runs_run_id_dismiss.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
organization_id path string Yes
id path string Yes
run_id path string Yes

Request body

application/json

Property Type Required Description
question_at string (date-time) Yes The run's finished_at when it stopped on the question being dismissed; a run since stopped on another question refuses the dismissal

Responses

200: The ended run; a run that worked in a thread made for it also has that thread archived

application/json

Property Type Required Description
action enum: run, resume Yes
automation object No Saved native automation identity. Name is its current catalog name; version identifies the immutable definition this run uses. Null for legacy runs.
automation.id string Yes
automation.key string Yes
automation.name string Yes
automation.version integer Yes
automation.version_id string Yes
budget_seconds integer Yes The run stops once it has been running this long
budget_usd number Yes The run stops before a step once it has spent this much
can_answer boolean Yes Whether this viewer can answer the step that stopped the run; the answer runs that step again
can_approve boolean Yes Whether this viewer can approve or decline the checkpoint the run waits at; only a person can approve one
can_dismiss boolean Yes Whether this viewer can dismiss the run waiting for them, which ends it unanswered
checkpoint object Yes The question a run waiting at a checkpoint is asking
checkpoint.kind enum: approval, input Yes
checkpoint.preview string No The checkpoint evidence shown to the person, bounded to 16 KiB.
checkpoint.prompt string Yes
checkpoint.step_id string No The id of the workflow file's step the run waits at, when the worker could tell
conversation_id string,null Yes The thread the run works in, which the person opens to follow it
decision_history object No
decision_history.items array of object Yes
decision_history.items[].attempt integer Yes
decision_history.items[].attempted_at string (date-time) Yes
decision_history.items[].finished_at string (date-time) Yes
decision_history.items[].position integer Yes
decision_history.items[].questions array of object Yes
decision_history.items[].questions[].name string Yes
decision_history.items[].questions[].prompt string Yes
decision_history.items[].questions[].result object Yes
decision_history.items[].questions[].result.choice string No
decision_history.items[].questions[].result.confidence number No
decision_history.items[].questions[].result.decision string Yes
decision_history.items[].questions[].result.model string No
decision_history.items[].questions[].result.pass_at integer No
decision_history.items[].questions[].result.probabilities object No
decision_history.items[].questions[].result.probability number No
decision_history.items[].questions[].result.reason string No
decision_history.items[].questions[].result.score number No
decision_history.items[].questions[].result.source enum: jev, fallback Yes
decision_history.items[].questions[].result.threshold number No
decision_history.items[].questions[].result.type enum: noul, choice, score No
decision_history.items[].status enum: pending, running, completed, interrupted, not_started Yes
decision_history.items[].step_id string Yes
decision_history.items[].usage_confirmed boolean Yes
decision_history.pagination object Yes
decision_history.pagination.limit integer Yes
decision_history.pagination.next string No
error string Yes
finished_at string Yes
flow_steps array of object Yes How the run went at each step of its workflow file, in the order it reached them; null when steps were recorded without their step of the file
flow_steps[].definition_step_id string Yes
flow_steps[].status enum: succeeded, running, waiting, sleeping, failed Yes
id string Yes
needs_you boolean Yes Whether a step stopped the run for the person, who can answer it
note string Yes One sentence a workflow step left for the person, which the run's card leads with
nothing_to_do_reason string Yes Why a run that succeeded did no work, as the step that found nothing to do said; null otherwise.
resume_count integer Yes How many times the run went on from a checkpoint; it tells one pause from the next, even at the same checkpoint
retry_step_id string Yes
running_seconds integer Yes How long the run has been running, not counting time waiting at a checkpoint or for a retry
source enum: chat, event, schedule, manual Yes
spent_tokens integer Yes The tokens the run's agent steps have used so far
spent_usd number Yes What the run's agent steps have cost so far, as the agent reported it
stalled boolean Yes Whether a running run has had no sign of its worker for five minutes; it continues if the worker comes back
started_at string Yes
started_by object Yes The event that started the run
started_by.kind string Yes
started_by.reference string Yes
started_by.source string Yes
started_by.title string Yes
status enum: running, succeeded, blocked, sleeping, step_failed, failed, ... Yes
step_count integer Yes
steps array of object Yes
steps[].attempt integer Yes
steps[].command string Yes
steps[].conversation_id string Yes The conversation an agent step ran in, readable with the agent's conversation endpoint; null for command steps
steps[].definition_step_id string Yes The id of the workflow file's step this attempt ran for; null for steps recorded before workers reported it
steps[].error string Yes
steps[].exit_code integer Yes
steps[].finished_at string Yes
steps[].id string Yes
steps[].kind enum: agent, command, message, gate Yes
steps[].model string Yes
steps[].output_bytes integer Yes
steps[].output_preview string Yes
steps[].output_preview_complete boolean Yes
steps[].output_truncated boolean Yes
steps[].risk object Yes What an agent step asked for its risk said about its change
steps[].risk.level enum: obvious, not_obvious Yes
steps[].risk.reason string Yes
steps[].sequence integer Yes
steps[].started_at string Yes
steps[].status enum: running, succeeded, failed, interrupted Yes
steps[].stopped object Yes Why an agent step that answered blocked stopped for the person, and the note it left them
steps[].stopped.note string Yes
steps[].stopped.reason string Yes
steps[].summary string Yes
steps[].waited object Yes What an agent step that answered waiting is waiting for; the run sleeps and the step looks again later
steps[].waited.reason string Yes
trigger_id string Yes The run settings that started it, for a run an event or schedule started
wake_at string Yes When a sleeping run's step looks again
workflow_digest string Yes SHA-256 of the immutable definition this run uses
workflow_path string Yes
401: Unauthorized
403: Forbidden
404: Not found
409: The run is not waiting for the person

application/json

Property Type Required Description
error string Yes
422: Unprocessable entity
502: Bad gateway

POST /api/v1/organizations/{organization_id}/agents/{id}/spark/workflow_runs/{run_id}/retry

Operation ID: post_api_v1_organizations_organization_id_agents_id_spark_workflow_runs_run_id_retry.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
organization_id path string Yes
id path string Yes
run_id path string Yes

Request body

application/json

The request body is object.

Responses

200: The reopened run, which the agent's worker continues from its failed step

application/json

Property Type Required Description
action enum: run, resume Yes
automation object No Saved native automation identity. Name is its current catalog name; version identifies the immutable definition this run uses. Null for legacy runs.
automation.id string Yes
automation.key string Yes
automation.name string Yes
automation.version integer Yes
automation.version_id string Yes
budget_seconds integer Yes The run stops once it has been running this long
budget_usd number Yes The run stops before a step once it has spent this much
can_answer boolean Yes Whether this viewer can answer the step that stopped the run; the answer runs that step again
can_approve boolean Yes Whether this viewer can approve or decline the checkpoint the run waits at; only a person can approve one
can_dismiss boolean Yes Whether this viewer can dismiss the run waiting for them, which ends it unanswered
checkpoint object Yes The question a run waiting at a checkpoint is asking
checkpoint.kind enum: approval, input Yes
checkpoint.preview string No The checkpoint evidence shown to the person, bounded to 16 KiB.
checkpoint.prompt string Yes
checkpoint.step_id string No The id of the workflow file's step the run waits at, when the worker could tell
conversation_id string,null Yes The thread the run works in, which the person opens to follow it
decision_history object No
decision_history.items array of object Yes
decision_history.items[].attempt integer Yes
decision_history.items[].attempted_at string (date-time) Yes
decision_history.items[].finished_at string (date-time) Yes
decision_history.items[].position integer Yes
decision_history.items[].questions array of object Yes
decision_history.items[].questions[].name string Yes
decision_history.items[].questions[].prompt string Yes
decision_history.items[].questions[].result object Yes
decision_history.items[].questions[].result.choice string No
decision_history.items[].questions[].result.confidence number No
decision_history.items[].questions[].result.decision string Yes
decision_history.items[].questions[].result.model string No
decision_history.items[].questions[].result.pass_at integer No
decision_history.items[].questions[].result.probabilities object No
decision_history.items[].questions[].result.probability number No
decision_history.items[].questions[].result.reason string No
decision_history.items[].questions[].result.score number No
decision_history.items[].questions[].result.source enum: jev, fallback Yes
decision_history.items[].questions[].result.threshold number No
decision_history.items[].questions[].result.type enum: noul, choice, score No
decision_history.items[].status enum: pending, running, completed, interrupted, not_started Yes
decision_history.items[].step_id string Yes
decision_history.items[].usage_confirmed boolean Yes
decision_history.pagination object Yes
decision_history.pagination.limit integer Yes
decision_history.pagination.next string No
error string Yes
finished_at string Yes
flow_steps array of object Yes How the run went at each step of its workflow file, in the order it reached them; null when steps were recorded without their step of the file
flow_steps[].definition_step_id string Yes
flow_steps[].status enum: succeeded, running, waiting, sleeping, failed Yes
id string Yes
needs_you boolean Yes Whether a step stopped the run for the person, who can answer it
note string Yes One sentence a workflow step left for the person, which the run's card leads with
nothing_to_do_reason string Yes Why a run that succeeded did no work, as the step that found nothing to do said; null otherwise.
resume_count integer Yes How many times the run went on from a checkpoint; it tells one pause from the next, even at the same checkpoint
retry_step_id string Yes
running_seconds integer Yes How long the run has been running, not counting time waiting at a checkpoint or for a retry
source enum: chat, event, schedule, manual Yes
spent_tokens integer Yes The tokens the run's agent steps have used so far
spent_usd number Yes What the run's agent steps have cost so far, as the agent reported it
stalled boolean Yes Whether a running run has had no sign of its worker for five minutes; it continues if the worker comes back
started_at string Yes
started_by object Yes The event that started the run
started_by.kind string Yes
started_by.reference string Yes
started_by.source string Yes
started_by.title string Yes
status enum: running, succeeded, blocked, sleeping, step_failed, failed, ... Yes
step_count integer Yes
steps array of object Yes
steps[].attempt integer Yes
steps[].command string Yes
steps[].conversation_id string Yes The conversation an agent step ran in, readable with the agent's conversation endpoint; null for command steps
steps[].definition_step_id string Yes The id of the workflow file's step this attempt ran for; null for steps recorded before workers reported it
steps[].error string Yes
steps[].exit_code integer Yes
steps[].finished_at string Yes
steps[].id string Yes
steps[].kind enum: agent, command, message, gate Yes
steps[].model string Yes
steps[].output_bytes integer Yes
steps[].output_preview string Yes
steps[].output_preview_complete boolean Yes
steps[].output_truncated boolean Yes
steps[].risk object Yes What an agent step asked for its risk said about its change
steps[].risk.level enum: obvious, not_obvious Yes
steps[].risk.reason string Yes
steps[].sequence integer Yes
steps[].started_at string Yes
steps[].status enum: running, succeeded, failed, interrupted Yes
steps[].stopped object Yes Why an agent step that answered blocked stopped for the person, and the note it left them
steps[].stopped.note string Yes
steps[].stopped.reason string Yes
steps[].summary string Yes
steps[].waited object Yes What an agent step that answered waiting is waiting for; the run sleeps and the step looks again later
steps[].waited.reason string Yes
trigger_id string Yes The run settings that started it, for a run an event or schedule started
wake_at string Yes When a sleeping run's step looks again
workflow_digest string Yes SHA-256 of the immutable definition this run uses
workflow_path string Yes
401: Unauthorized
403: Forbidden
404: Not found
409: The run cannot be retried

application/json

Property Type Required Description
error string Yes
422: Unprocessable entity
502: Bad gateway

list

GET /api/v1/organizations/{organization_id}/agents/{id}/spark/workflow_runs

Operation ID: spark_workflow_runs_api_v1_organization_persistent_agent.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
organization_id path string Yes
id path string Yes
cursor query string No
limit query integer No
view query enum: activity No Activity places running, sleeping, blocked, and waiting runs above recent history. Activity does not accept a cursor.
workflow_path query string No Only runs of this workflow file
automation_key query string No Runs across all versions of this saved native automation; cannot be combined with workflow_path.

Responses

200: Recorded workflow runs, newest first

application/json

Property Type Required Description
items array of object Yes
items[].action enum: run, resume Yes
items[].automation object No Saved native automation identity. Name is its current catalog name; version identifies the immutable definition this run uses. Null for legacy runs.
items[].automation.id string Yes
items[].automation.key string Yes
items[].automation.name string Yes
items[].automation.version integer Yes
items[].automation.version_id string Yes
items[].budget_seconds integer Yes The run stops once it has been running this long
items[].budget_usd number Yes The run stops before a step once it has spent this much
items[].can_answer boolean Yes Whether this viewer can answer the step that stopped the run; the answer runs that step again
items[].can_approve boolean Yes Whether this viewer can approve or decline the checkpoint the run waits at; only a person can approve one
items[].can_dismiss boolean Yes Whether this viewer can dismiss the run waiting for them, which ends it unanswered
items[].checkpoint object Yes The question a run waiting at a checkpoint is asking
items[].checkpoint.kind enum: approval, input Yes
items[].checkpoint.preview string No The checkpoint evidence shown to the person, bounded to 16 KiB.
items[].checkpoint.prompt string Yes
items[].checkpoint.step_id string No The id of the workflow file's step the run waits at, when the worker could tell
items[].conversation_id string,null Yes The thread the run works in, which the person opens to follow it
items[].error string Yes
items[].finished_at string Yes
items[].id string Yes Public run ID. Saved Temporal automations use the swr_ prefix. Previously issued IDs still resolve.
items[].needs_you boolean Yes Whether a step stopped the run for the person, who can answer it
items[].note string Yes One sentence a workflow step left for the person, which the run's card leads with
items[].resume_count integer Yes How many times the run went on from a checkpoint; it tells one pause from the next, even at the same checkpoint
items[].running_seconds integer Yes How long the run has been running, not counting time waiting at a checkpoint or for a retry
items[].source enum: chat, event, schedule, manual Yes
items[].spent_tokens integer Yes The tokens the run's agent steps have used so far
items[].spent_usd number Yes What the run's agent steps have cost so far, as the agent reported it
items[].stalled boolean Yes Whether a running run has had no sign of its worker for five minutes; it continues if the worker comes back
items[].started_at string Yes
items[].started_by object Yes The event that started the run
items[].started_by.kind string Yes
items[].started_by.reference string Yes
items[].started_by.source string Yes
items[].started_by.title string Yes
items[].status enum: running, succeeded, blocked, sleeping, step_failed, failed, ... Yes
items[].step_count integer Yes
items[].trigger_id string Yes The run settings that started it, for a run an event or schedule started
items[].wake_at string Yes When a sleeping run's step looks again
items[].workflow_digest string Yes SHA-256 of the immutable definition this run uses
items[].workflow_path string Yes
pagination object Yes
pagination.limit integer Yes
pagination.next string No
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway

load

GET /api/v1/organizations/{organization_id}/agents/{id}/spark/workflow_runs/{run_id}

Operation ID: get_api_v1_organizations_organization_id_agents_id_spark_workflow_runs_run_id_.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
organization_id path string Yes
id path string Yes
run_id path string Yes
decision_cursor query string No Cursor for older decision attempts returned by decision_history.pagination.next.

Responses

200: A recorded workflow run and its steps

application/json

Property Type Required Description
action enum: run, resume Yes
automation object No Saved native automation identity. Name is its current catalog name; version identifies the immutable definition this run uses. Null for legacy runs.
automation.id string Yes
automation.key string Yes
automation.name string Yes
automation.version integer Yes
automation.version_id string Yes
budget_seconds integer Yes The run stops once it has been running this long
budget_usd number Yes The run stops before a step once it has spent this much
can_answer boolean Yes Whether this viewer can answer the step that stopped the run; the answer runs that step again
can_approve boolean Yes Whether this viewer can approve or decline the checkpoint the run waits at; only a person can approve one
can_dismiss boolean Yes Whether this viewer can dismiss the run waiting for them, which ends it unanswered
checkpoint object Yes The question a run waiting at a checkpoint is asking
checkpoint.kind enum: approval, input Yes
checkpoint.preview string No The checkpoint evidence shown to the person, bounded to 16 KiB.
checkpoint.prompt string Yes
checkpoint.step_id string No The id of the workflow file's step the run waits at, when the worker could tell
conversation_id string,null Yes The thread the run works in, which the person opens to follow it
decision_history object No
decision_history.items array of object Yes
decision_history.items[].attempt integer Yes
decision_history.items[].attempted_at string (date-time) Yes
decision_history.items[].finished_at string (date-time) Yes
decision_history.items[].position integer Yes
decision_history.items[].questions array of object Yes
decision_history.items[].questions[].name string Yes
decision_history.items[].questions[].prompt string Yes
decision_history.items[].questions[].result object Yes
decision_history.items[].questions[].result.choice string No
decision_history.items[].questions[].result.confidence number No
decision_history.items[].questions[].result.decision string Yes
decision_history.items[].questions[].result.model string No
decision_history.items[].questions[].result.pass_at integer No
decision_history.items[].questions[].result.probabilities object No
decision_history.items[].questions[].result.probability number No
decision_history.items[].questions[].result.reason string No
decision_history.items[].questions[].result.score number No
decision_history.items[].questions[].result.source enum: jev, fallback Yes
decision_history.items[].questions[].result.threshold number No
decision_history.items[].questions[].result.type enum: noul, choice, score No
decision_history.items[].status enum: pending, running, completed, interrupted, not_started Yes
decision_history.items[].step_id string Yes
decision_history.items[].usage_confirmed boolean Yes
decision_history.pagination object Yes
decision_history.pagination.limit integer Yes
decision_history.pagination.next string No
error string Yes
finished_at string Yes
flow_steps array of object Yes How the run went at each step of its workflow file, in the order it reached them; null when steps were recorded without their step of the file
flow_steps[].definition_step_id string Yes
flow_steps[].status enum: succeeded, running, waiting, sleeping, failed Yes
id string Yes
needs_you boolean Yes Whether a step stopped the run for the person, who can answer it
note string Yes One sentence a workflow step left for the person, which the run's card leads with
nothing_to_do_reason string Yes Why a run that succeeded did no work, as the step that found nothing to do said; null otherwise.
resume_count integer Yes How many times the run went on from a checkpoint; it tells one pause from the next, even at the same checkpoint
retry_step_id string Yes
running_seconds integer Yes How long the run has been running, not counting time waiting at a checkpoint or for a retry
source enum: chat, event, schedule, manual Yes
spent_tokens integer Yes The tokens the run's agent steps have used so far
spent_usd number Yes What the run's agent steps have cost so far, as the agent reported it
stalled boolean Yes Whether a running run has had no sign of its worker for five minutes; it continues if the worker comes back
started_at string Yes
started_by object Yes The event that started the run
started_by.kind string Yes
started_by.reference string Yes
started_by.source string Yes
started_by.title string Yes
status enum: running, succeeded, blocked, sleeping, step_failed, failed, ... Yes
step_count integer Yes
steps array of object Yes
steps[].attempt integer Yes
steps[].command string Yes
steps[].conversation_id string Yes The conversation an agent step ran in, readable with the agent's conversation endpoint; null for command steps
steps[].definition_step_id string Yes The id of the workflow file's step this attempt ran for; null for steps recorded before workers reported it
steps[].error string Yes
steps[].exit_code integer Yes
steps[].finished_at string Yes
steps[].id string Yes
steps[].kind enum: agent, command, message, gate Yes
steps[].model string Yes
steps[].output_bytes integer Yes
steps[].output_preview string Yes
steps[].output_preview_complete boolean Yes
steps[].output_truncated boolean Yes
steps[].risk object Yes What an agent step asked for its risk said about its change
steps[].risk.level enum: obvious, not_obvious Yes
steps[].risk.reason string Yes
steps[].sequence integer Yes
steps[].started_at string Yes
steps[].status enum: running, succeeded, failed, interrupted Yes
steps[].stopped object Yes Why an agent step that answered blocked stopped for the person, and the note it left them
steps[].stopped.note string Yes
steps[].stopped.reason string Yes
steps[].summary string Yes
steps[].waited object Yes What an agent step that answered waiting is waiting for; the run sleeps and the step looks again later
steps[].waited.reason string Yes
trigger_id string Yes The run settings that started it, for a run an event or schedule started
wake_at string Yes When a sleeping run's step looks again
workflow_digest string Yes SHA-256 of the immutable definition this run uses
workflow_path string Yes
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway

GET /api/v1/organizations/{organization_id}/agents/{id}/spark/workflow_runs/summary

Operation ID: spark_workflow_runs_summary_api_v1_organization_persistent_agent.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
organization_id path string Yes
id path string Yes

Responses

200: Each workflow's runs over the last 30 days

application/json

Property Type Required Description
days integer Yes
since string (date-time) Yes
workflows array of object Yes Workflows with a run since since; a workflow that has not run is absent.
workflows[].cost_complete boolean Yes False when some step's cost was unknown, so spent_usd is a floor.
workflows[].failed integer Yes Runs that ended on a failed step, a failure, an interruption or a used budget. Runs waiting for someone are not failed.
workflows[].last_run_at string (date-time) Yes
workflows[].runs integer Yes
workflows[].spent_usd number Yes
workflows[].workflow_path string Yes
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway