Modifica

Workflow concepts

Agent Framework workflows define explicit, inspectable execution paths for coordinating code, agents, state, events, and human input. The framework provides functional and graph-based APIs over the same workflow run model.

Workflow APIs

All SDKs support graph-based workflows. Python additionally provides an experimental functional workflow API.

The .NET SDK uses the graph-based WorkflowBuilder API. It connects typed executors through edges and conditions, supports fan-out and fan-in execution, emits workflow and executor events, and checkpoints progress at superstep boundaries. Compatible workflows can be exposed through the standard agent interface with AsAIAgent().

Both APIs produce the same observable workflow results. Choose the API that matches the execution model you want to express:

Functional (@workflow) Graph (WorkflowBuilder)
Control flow Native Python (if, loops, asyncio.gather) Edges and conditions
Best for Sequential pipelines, custom loops, and ad-hoc parallelism Fixed graphs, fan-out/fan-in, and type-validated message routing
Parallelism asyncio.gather Parallel edge groups and superstep execution
Observability Per-step events with @step Per-executor events
Human-in-the-loop ctx.request_info() RequestInfoExecutor
Checkpointing Per-@step result caching Superstep-boundary checkpoints
Agent wrapping .as_agent() on FunctionalWorkflow .as_agent() on Workflow

The Go SDK uses the graph-based workflow.NewBuilder API. It connects bound executors through edges, conditions, and fan-out or fan-in groups, then runs the graph through an execution environment such as inproc.Default. Agent-oriented workflows can be exposed through the standard agent interface with agentworkflow.New(...).

Graph and runtime model

  • Executors receive inputs, perform work, and emit outputs.
  • Edges route values between executors.
  • Events expose workflow lifecycle and execution activity.
  • State management controls durable and run-scoped workflow state.

Advanced execution

For feature-oriented guidance such as checkpoints, human-in-the-loop, visualization, and orchestrations, see Workflow Capabilities.

Next steps