Skip to content

Runs

A run (workflow instance) is one execution of a workflow by an agent. Queueing a run returns immediately; execution proceeds in the background and everything about it is observable.

Lifecycle

Idle ──▶ Running ──▶ Completed
                └──▶ Failed     (failure reason recorded)
                └──▶ Cancelled
  • Queue a run with a workflow, an agent, and optional initial context.
  • Cancel a running instance at any time — the in-flight step is signalled to stop at its next checkpoint, and the cancellation cascades to the child step and agent instances.
  • A failed run records why — a step error, or a breached execution limit.

What a step execution involves

For each step, in order:

  1. An agent instance is created — the identity-bearing execution shell for this step.
  2. A token exchange delegates the initiating user to the agent, restricted to the step's resource (audience) and tool scope. See Identity & Security.
  3. A step instance runs the model against the step instruction plus the current visible context.
  4. The model may call the step's tool (bounded by the tool-rounds limit); tool calls carry the delegated token.
  5. Outputs are promoted into the context channel, the instances complete, and the next step begins.

A step failure fails the run — later steps do not execute.

The context channel

The run's context is its only cross-step data channel. Every entry has a key, a value, and a provenance kind:

KindMeaning
InputSupplied by the caller when the run was queued.
ToolOutputA tool's deterministic result — the authoritative data channel.
ModelTextThe model's own text — a summary or narrative, not authoritative data.

Step outputs are promoted under predictable keys, numbered by the step's 1-based execution order:

  • toolResult_<n> — the step's last tool result (only when the step made a tool call).
  • modelResponse_<n> — the step's final model text.

Later steps see the most recent value per key, so instructions can reference earlier results by these keys (e.g. "using the match verdict in toolResult_1…").

Observability

  • Run summary — step progress, total tokens, average model latency, timing.
  • Model calls — every LLM invocation with input, output, token counts, latency, finish reason, and round.
  • Tool calls — every tool invocation per step.
  • Activities — the audit feed of lifecycle events across the platform.
  • Run Inputs — including the reserved task_id and purpose keys.
  • Automation — starting runs on a schedule or from an event instead of by hand.
  • Evaluations — scoring a workflow's runs against expected cases.

Agentfleet — agent workflow orchestration.