Start a run
A run executes a script with a toolset, or a version of a workflow, for one end user.The TypeScript source: one ES module whose default export is the entry point. Or give
workflow instead.Instead of a script:
"triage" for the workflow’s latest version, "triage@9f2c4e1a07b3" for one version. The input
is checked against its input schema.Wait up to this long for the run to end. The run is returned as it is then: ended, or still active with what it waits
for. Without it, the call returns once the run is created, before it ran.
A request repeated with the same key returns the run the first one started, instead of starting another.
Your metadata: the agent, the conversation, the environment. Labels filter runs in the API and the dashboard, scope
list_runs, keys and tokens limited to labels, and webhook subscriptions. The script never sees them.The W3C trace context of the caller, typically the LLM call that wrote the script: the run appears under it in your
traces.
tracestate too.The run’s time to live: it is cancelled at its deadline. Bounded by the end user’s
maxTtl.Type-check the script before starting it. A refused script throws
RewindApiError with the slug invalid-script and
its diagnostics. A workflow’s script is not checked again.Read a run
input, output, tool arguments and results) are payloads: { digest, bytes, preview, value }. A value larger
than 256 KiB is left out; read it with rewind.payloads.get(digest).
Follow a run live
events is an async iterator over the run’s journal entries as they are committed. A dropped connection resumes after
the last entry received.
The trace, for a model or a human
trace returns the run as a model reads it: each event with its line, its outcome and its timing.
Search runs
Runs are searched with the query language, the same as the dashboard’s query bar and the CLI.status, labels, tool, script, error, workflow, startedBy, parent,
quarantined. A query that cannot be read is refused with invalid-query, and the error says where the term at fault
is.
Cancel a run
Every pendingawait of the script rejects with CancelledError, and the script gets one activation to clean up.
Fork a run with a corrected script
A fork reuses the parent’s recorded results while the corrected script makes the same calls, then continues live: the calls already made are not made again. This is what the agent toolretry_run does.
parent names the run
it came from.
Export a run
Quarantine and deletion
A run whose replay diverged from its journal, or whose activations failed 5 times in a row, is quarantined (run.quarantine
says why). It is not failed: fix the cause, then release it, or give it up.