In short.
Pydantic Graph’s Steps guide is a practical tutorial for Python developers building graph workflows, but it assumes an available package and gives no compatible version information. It explains how asynchronous functions become nodes, how values pass between them, and how streaming output feeds parallel work and aggregation. The examples provide expected outputs; execution, performance and operational reliability were not assessed.
Researched and written by an AI model and checked by a second AI model. How it works
Coverage is the complete Steps page at [https://pydantic.dev/docs/ai/graph/builder/steps/index.md], including its documentation-index and query-parameter notices, examples and next-step links. The linked documentation index, API references, parallel-execution guide, join guide and branching guide are excluded. No code was executed. Installation, type-checker behavior, version compatibility, performance and operational behavior were not assessed.
The overview
Identity
This documentation page explains the Steps feature of the pydantic_graph GraphBuilder API. A step is an asynchronous function that receives a StepContext and returns a value. The original page is available at [https://pydantic.dev/docs/ai/graph/builder/steps/index.md].
Its examples use counters, message lists and arithmetic. Although the page sits within Pydantic’s AI documentation, these examples do not demonstrate language-model calls or agent behavior.
Assessment
The guide provides a useful introduction to defining and connecting graph steps. It progresses from one mutable counter to sequential transformations and streamed processing, making the same API understandable at several levels of complexity.
Its usefulness is strongest at the feature-learning stage. The page does not establish installation requirements, deployment behavior or reliability under failures.
Users
Python developers learning graph-based workflow construction are the clearest audience. Beginners need familiarity with async functions, await, dataclasses and type annotations to follow the examples comfortably.
Experienced developers can use the page to understand the separation between mutable state, injected dependencies and per-step inputs, and to see how streaming connects to mapped processing and joins.
Capabilities
The page demonstrates registering functions with @g.step, reading and changing graph state, transforming incoming values, and accessing supplied dependencies. It also shows sequential connections, custom node identifiers, and labels intended for diagram documentation.
Streaming examples use @g.stream to yield multiple values, .map() to process those values through another step, and a join with reduce_list_append to collect results. The add_edge() helper provides a shorter form for simple connections.
Using it
Requirements
The examples require a Python environment containing pydantic_graph. They use dataclasses, asynchronous functions and generic type annotations. The page specifies neither a minimum Python version nor a compatible package release.
The examples also need an asynchronous entry point. The page explicitly says to import asyncio and invoke asyncio.run(main()). No model provider, API credential or GPU appears in the examples.
Mechanism
GraphBuilder declares the graph’s state, dependency, input and output types as needed. Decorated functions become steps, edges connect the start node through those steps to the end node, and g.build() creates the graph used by await graph.run(...).
StepContext[StateT, DepsT, InputT] exposes shared mutable state through ctx.state, supplied dependencies through ctx.deps, and the current step’s input through ctx.inputs. Connected examples pass a step’s returned value into the next step.
For streaming, the guide describes an AsyncIterable whose yielded values trigger dynamically created parallel tasks when mapped. It also describes generic annotations as supporting type checks across state, dependencies and connected values; runtime enforcement is not established.
Setup
Once a compatible environment is available, the demonstrated setup is to define state, construct GraphBuilder, decorate step functions, connect them, build the graph and supply state when calling graph.run(). Dependency and input objects are supplied when the graph declares those types.
The page provides no installation command, dependency lockfile or type-checker configuration. Some customization snippets import objects from earlier example files, so they depend on those files being available.
Example
The sequential example connects three steps that add five, multiply by two and subtract three. With an input of 10, its documented expected result is 27. Each step also appends a description to a shared operations list, illustrating how returned values and shared state serve different purposes.
The streaming example yields integers from one through five, maps them through a squaring step and collects the results. Its displayed output is sorted as [1, 4, 9, 16, 25], so the example does not establish collection order. These are documented expectations; nothing was executed.
Assessment & evidence
Limitations
The guide does not explain retries, exception handling, cancellation, persistence, concurrency limits or backpressure. Shared state can be mutated, but coordination of competing writes during parallel processing is not explained.
The examples use small in-memory values. They provide no benchmarks, large-dataset measurements, production evidence or compatibility matrix. Claims about throughput, memory use and failure recovery would need additional evidence.
Reasoning
The demonstrated design is useful when a workflow benefits from explicit connections, separately typed inputs and dependencies, or processing values before an entire stream has arrived. These needs correspond directly to the page’s examples.
A reasonable design inference is that graph construction adds concepts to learn compared with a short sequence of function calls. The page does not measure that tradeoff or establish whether this approach improves a particular application.
Alternatives
For a short sequential transformation, directly calling asynchronous functions is an architectural alternative to introducing graph nodes. This is a design inference; the page supplies no comparative evaluation.
Within the documented API, add_edge() offers concise simple connections, while the examples also use g.add() with edge_from(). Regular steps return one value; streaming steps yield multiple values. Separate guides for parallel execution, joins and conditional branching are linked, but their contents are outside this page’s scope.
Evidence
The evidence consists of the complete Steps documentation page at [https://pydantic.dev/docs/ai/graph/builder/steps/index.md], including explanatory text, Python examples and expected outputs. Its captured source revision is sha256:8180a5246c45e189d24943c70b54e0ec80a2ecbdf4ef176a240722849aa6cc18.
The examples support an explanation of the documented API. They do not establish successful execution, passing type checks or measured behavior in an independent environment.
Access & freshness
Costs
The page states no price, licence fee or operating-cost estimate. Its examples do not configure a paid model service. Package-related charges and the cost of running a real workflow remain unknown from this evidence.
Rights
The supplied page contains no licence text or reuse terms for the documentation, example code or underlying package. Copying and redistribution rights are unknown from this page.
Freshness
The source was captured on 15 November 2026 at 12:11:26.388 UTC. The page provides no publication date, last-update date or package version. Compatibility with any particular installed release and changes after capture are unknown.
Actions
Before adopting the API, confirm installation instructions and compatible Python and package versions in the package’s documentation. Reproduce a sequential example in your own environment and check its annotations with your chosen type checker.
For streaming workflows, establish concurrency limits, cancellation behavior, result ordering and coordination of shared-state changes before relying on them. Consult the linked parallel-execution and join guides for further detail, and obtain applicable licence terms before redistributing code.
