Agents

Reviewed, versioned automation that runs several steps, asks for sign-off, and hands work back to a person.

View as Markdown

The capability verbs do one thing per call. An agent does a sequence of things. Example: read the intake pack, extract the fields, fill the form, wait for a human to countersign, file the result. An agent is a saved, reviewed automation. It holds a list of steps, the saved configs it may use, and the points where a person must sign off.

GET /v1/agents lists the agents your organization can run. POST /v1/agent-runs starts one on a set of files. After that, you work with one object: the agent run (agr_…). Poll it or subscribe to it.

An agent in the API is a playbook in the CloudRaker app. They are the same object with the same runs. What you build and review under Playbooks is what GET /v1/agents returns. A run started over the API also shows up there.

An agent

1{
2 "object": "agent",
3 "id": "01JQ8ZKMRT4V6WXYZ0ABCDEFGH",
4 "name": "Client intake",
5 "description": "Reads an intake pack, files the data, and collects a signature.",
6 "version": 7,
7 "tasks": [
8 { "id": "task-1", "title": "Extract the intake fields", "executor": "agent", "dependsOn": [] },
9 { "id": "task-2", "title": "Countersign the engagement letter", "executor": "human", "dependsOn": ["task-1"] }
10 ],
11 "actions": [
12 { "name": "Extract structured data", "approval": "output" },
13 { "name": "Sign document", "approval": "before" }
14 ],
15 "updatedAt": "2026-07-28T14:02:11.884Z"
16}
FieldWhat it tells you
tasks[]The step ledger: the shape of the work. executor: "human" marks the steps that come back to you. dependsOn lists the steps that must close before a step opens.
actions[]What the agent may do, and the approval gate on each.
versionThe revision a new run will snapshot. Edits to the agent do not change runs already in flight.

The API lists only active agents. Ids are opaque strings. Do not parse them.

Who does each step

Every step has an executor. That field sets the full division of labour:

On a run, each step also carries a status: pending (blocked on its dependsOn), ready (open), in_progress, completed, or skipped. A skipped step satisfies dependencies the same way a completed step does.

Sign-off gates

An action’s approval says where a human must agree before the agent proceeds:

approvalGate
autoNo sign-off. The agent runs the action.
beforeApprove the proposed inputs before the action runs. The approval carries the params the agent wants to use.
outputApprove the result before the agent uses it.
bothBoth gates.

Every outstanding sign-off appears in approvals[] on the run. Each entry carries a kind of before or output, the action’s name, and the files it touches. A before gate also carries the proposed params. Answer it with POST /v1/agent-runs/:id/approvals/:approvalId. When you approve, you can replace those params or files first. When you reject, you must include a note.

Run statuses

StatusMeaning
queuedAccepted. The API is still preparing its files. Reading the run picks it up once they are ready.
processingThe agent is working.
waitingBlocked on a person. See waiting, approvals[], and the ready human steps in tasks[].
pausedStopped short and resumable. Not a failure. paused.reason is model_error or system_error.
completedFinished. The run carries result and output.
failedFinished without a result. error.code and error.message say why.
cancelledStopped on request.
expiredReached expiresAt without finishing.

completed, failed, cancelled, and expired are terminal.

A completed run that had outstanding work also carries incomplete: true. The run closed with unfinished steps, and tasks[] shows which. Treat this as done with gaps, not as a failure.

A paused run keeps everything it produced, and you can start it again. The API never takes back work an agent run already filed: imported records, attached files, or a sealed signature. This holds at every status.

Long-lived by design

An agent run that is blocked on a person can wait days. The API supports that:

  • expiresAt is about seven days out. That is the run’s deadline, not a cleanup timer. An unfinished run parks itself for good when it passes the deadline. A human step must land before then.
  • The API never purges input files on a deadline. Files you pass as { "url": … } join your reusable file corpus. The run keeps its inputs however long it waits. POST /v1/agent-runs has no ttl.
  • output.files[] links are short-lived. Each signed URL is valid for about an hour. Re-read the run to get a fresh one.

Agent runs are a separate surface from runs. They do not appear in GET /v1/runs. They have no list endpoint, and no cancel or delete. Keep the agr_ id you got at create, or find the run again with your own metadata.

Next steps