flows.run
variables— override Flow variables per call. Same shape as the triggervariablesfield.model— override the agent model for this run only (respects your workspace routing / BYOK).idempotencyKey— send the same key twice and the server returns the first execution instead of running again.
traceId and any partial outputs so you can log, retry, or degrade — always inspect .status and .failure on the return value. Transport / auth / request errors do throw; see Errors.
newTraceRef
Weave traces, signals, and feedback through your own logs with a correlation id you can assert before the trace exists.
traceId from the server response.
Common patterns
Degrade on partial
Idempotent retries
If you’re retrying at the HTTP layer (e.g. because your handler timed out but the server may already be processing), pass the sameidempotencyKey on the retry. The server returns the original execution’s traceId instead of starting a new run.
Surface notices, not failures
notices[] are things that shaped the run but aren’t failures (tool-call cap hit, retrieval returned nothing, output truncated). Log them or show them to your admin UI, but don’t surface as errors to end users.
MCP / CLI equivalents
While the SDK is pre-publish, the same operation is available via MCP and the CLI:flows.run — traceId · status · outputs · notices · failure.