graph.Invoke for compile-and-run convenience. Compile once and reuse Compiled.Execute when invoking the same graph repeatedly. Treat the compiled definition and its dependencies as immutable after registration.
Execute
Withcompiled and a request ctx:
RunID is generated. RunContext.input is the conventional business input; RunContext.context holds application context forwarded to integrations. Metadata carries trusted identity such as namespace, thread, and session IDs.
The built-in integration nodes default namespace to default when absent. Your application remains responsible for deciding which namespace and credentials are permitted.
Inspect state
Status records running, completed, paused, failed, cancelled, or skipped nodes. Ports records completed output ports. RunContext holds merged output. Suspended retains all paused nodes in a parallel wave; Pause identifies the currently surfaced pause.
On execution failure, the local runtime returns partial state alongside the error. Do not discard it if you need diagnostics or recovery. Concurrent executions must use separate Input values; never execute one checkpoint simultaneously from two requests.
Invocation options
The default runtime uses cancellable goroutines and waits for the current wave to settle. Its runtime interface uses Go
context.Context. The Temporal executor has a separate entry point because Temporal uses its own workflow context.
Register by name
The SDK registry can hold agents and workflows in separate name spaces:Workflow and WorkflowNames expose lookup and discovery. Applications using only pkg/workflow can use workflow.NewRegistry, Register, and Execute instead.
Registration is process-local configuration. It does not persist YAML, publish a new agent tool, or register anything with a running Temporal worker. Use HTTP invocation or workflow tools as separate integration steps.