Runs
A run is a single execution of a workflow against one input. Runs execute the crew sequentially and record a step per agent.
The run object#
idstringoptionalworkflow_idstringoptionalstatusstringoptionalqueued, running, waiting_input, completed, or failed. A run sits in waiting_input when an agent has paused for a human — see Respond to a paused run.inputstringoptionaloutputstring | nulloptionalnull until the run completes.errorstring | nulloptionalnull unless the run failed.total_stepsintegeroptionaltokens_inintegeroptionaltokens_outintegeroptionalstarted_atstring | nulloptionalnull while queued.finished_atstring | nulloptionalnull.created_atstringoptionalpendingobject | nulloptionalnull unless status is waiting_input. Has kind ("input" or "approval"), prompt (the question, or a short summary of the action), and for approvals tool + tool_input (the tool and arguments awaiting your go-ahead).stepsStep[]optionalThe step object
idstringoptionalorderintegeroptionalrolestringoptionalmodelstringoptionalinputstringoptionaloutputstring | nulloptionalnull if it hasn't finished or errored.errorstring | nulloptionaltokens_inintegeroptionaltokens_outintegeroptionalstarted_atstring | nulloptionalfinished_atstring | nulloptionalTrigger a run#
/v1/workflows/{id}/runsQueues a run for the given workflow and starts executing it asynchronously. Responds with 202 Accepted and the run in the queued state. Returns 409 Conflict if the workflow is paused, or 404 if it isn't found.
Path parameters
idstringrequiredBody parameters
inputstringrequiredRequest
curl -X POST https://api.loopllama.ai/v1/workflows/ckva.../runs \
-H "Authorization: Bearer $LOOPLLAMA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input": "Draft a 200-word brief on a new feature-flag system."}'Response
{
"data": {
"id": "ckrun1...",
"workflow_id": "ckva...",
"status": "queued",
"input": "Draft a 200-word brief on a new feature-flag system.",
"output": null,
"error": null,
"total_steps": 0,
"tokens_in": 0,
"tokens_out": 0,
"started_at": null,
"finished_at": null,
"created_at": "2026-05-20T17:10:00.000Z"
}
}List runs for a workflow#
/v1/workflows/{id}/runsReturns the workflow's 50 most recent runs, newest first. Step details are omitted from list responses — retrieve a run by id to get them.
Request
curl https://api.loopllama.ai/v1/workflows/ckva.../runs \
-H "Authorization: Bearer $LOOPLLAMA_API_KEY"Response
{
"data": [
{
"id": "ckrun1...",
"workflow_id": "ckva...",
"status": "completed",
"input": "Draft a 200-word brief...",
"output": "Feature flags let teams...",
"error": null,
"total_steps": 2,
"tokens_in": 412,
"tokens_out": 286,
"started_at": "2026-05-20T17:10:01.000Z",
"finished_at": "2026-05-20T17:10:09.000Z",
"created_at": "2026-05-20T17:10:00.000Z"
}
]
}Retrieve a run#
/v1/runs/{id}Fetches a single run including its ordered steps. Poll this endpoint until status is completed or failed.
Path parameters
idstringrequiredRequest
curl https://api.loopllama.ai/v1/runs/ckrun1... \
-H "Authorization: Bearer $LOOPLLAMA_API_KEY"Response
{
"data": {
"id": "ckrun1...",
"workflow_id": "ckva...",
"status": "completed",
"input": "Draft a 200-word brief on a new feature-flag system.",
"output": "Feature flags let teams ship safely...",
"error": null,
"total_steps": 2,
"tokens_in": 412,
"tokens_out": 286,
"started_at": "2026-05-20T17:10:01.000Z",
"finished_at": "2026-05-20T17:10:09.000Z",
"created_at": "2026-05-20T17:10:00.000Z",
"steps": [
{
"id": "ckstep1...",
"order": 0,
"role": "planner",
"model": "claude-sonnet-4-6",
"input": "Draft a 200-word brief...",
"output": "1. Define feature flags...",
"error": null,
"tokens_in": 180,
"tokens_out": 120,
"started_at": "2026-05-20T17:10:01.000Z",
"finished_at": "2026-05-20T17:10:04.000Z"
},
{
"id": "ckstep2...",
"order": 1,
"role": "writer",
"model": "claude-sonnet-4-6",
"input": "Original request:\n...\n\nPrior agent output:\n--- planner ---\n...",
"output": "Feature flags let teams ship safely...",
"error": null,
"tokens_in": 232,
"tokens_out": 166,
"started_at": "2026-05-20T17:10:04.000Z",
"finished_at": "2026-05-20T17:10:09.000Z"
}
]
}
}status is completed or failed — and watch for waiting_input, which means the run has paused for you. The SDKs expose a poll() helper that does this for you — see SDKs.Respond to a paused run#
/v1/runs/{id}/respondWhen a workflow enables human-in-the-loop, a run can pause itself. An agent pauses to ask a question (when the workflow allows agents to request input) or to wait for approval before a sensitive action runs (sending email, writing to a CRM). While paused, status is waiting_input and the run's pending object describes what it needs. This endpoint supplies the answer or decision and resumes the run; it responds with 202 Accepted.
Path parameters
idstringrequiredwaiting_input).Body parameters
actionstringrequired"input" to answer a question; "approve" or "reject" to decide an approval. Must match the run's pending.kind.inputstringoptionalaction is "input".reasonstringoptionalaction is "reject" (e.g. why you declined, or what to do instead).Answer a question
curl -X POST https://api.loopllama.ai/v1/runs/ckrun1.../respond \
-H "Authorization: Bearer $LOOPLLAMA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"action": "input", "input": "Use a friendly, concise tone and target SMB owners."}'Approve or reject a sensitive action
# Approve — the gated tool runs, then the agent continues
curl -X POST https://api.loopllama.ai/v1/runs/ckrun1.../respond \
-H "Authorization: Bearer $LOOPLLAMA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"action": "approve"}'
# Reject — the tool is skipped and the agent is told why
curl -X POST https://api.loopllama.ai/v1/runs/ckrun1.../respond \
-H "Authorization: Bearer $LOOPLLAMA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"action": "reject", "reason": "Do not email external addresses."}'Response
{
"data": {
"id": "ckrun1...",
"status": "running"
}
}status: "waiting_input", read pending to learn what the agent needs, call this endpoint with the matching action, then keep polling. A run may pause more than once. Sending the wrong action for the current pending.kind returns 400; responding to a run that isn't paused returns 409.