Summary
Track docs updates for the functional workflow API shipped in #4238 (closed #3537). Code, tests, and samples have landed; user-facing docs on the Learn site still need coverage so users can discover and adopt the new API alongside the existing graph-based WorkflowBuilder.
What shipped in #4238
@workflow decorator — write workflows as plain async functions using native Python control flow (if/else, loops, asyncio.gather) instead of executor classes, edges, and builder patterns
@step decorator — opt-in, saves results for HITL resume and crash recovery; plain functions work inside @workflow without it and simply re-execute on resume
RunContext — optional parameter, needed only for HITL (ctx.request_info()), custom events (ctx.add_event()), or state (ctx.get_state() / ctx.set_state())
- Streaming —
workflow.run(stream=True)
- HITL —
ctx.request_info() with replay semantics
.as_agent() — wraps a functional workflow as an agent-compatible object
- Samples under
python/samples/01-get-started/ (05_functional_workflow_with_agents.py, 06_functional_workflow_basics.py) and python/samples/03-workflows/functional/ (basic_pipeline, basic_streaming_pipeline, parallel_pipeline, hitl_review, steps_and_checkpointing, agent_integration, naive_group_chat)
Docs work to do
References
Summary
Track docs updates for the functional workflow API shipped in #4238 (closed #3537). Code, tests, and samples have landed; user-facing docs on the Learn site still need coverage so users can discover and adopt the new API alongside the existing graph-based
WorkflowBuilder.What shipped in #4238
@workflowdecorator — write workflows as plain async functions using native Python control flow (if/else, loops,asyncio.gather) instead of executor classes, edges, and builder patterns@stepdecorator — opt-in, saves results for HITL resume and crash recovery; plain functions work inside@workflowwithout it and simply re-execute on resumeRunContext— optional parameter, needed only for HITL (ctx.request_info()), custom events (ctx.add_event()), or state (ctx.get_state()/ctx.set_state())workflow.run(stream=True)ctx.request_info()with replay semantics.as_agent()— wraps a functional workflow as an agent-compatible objectpython/samples/01-get-started/(05_functional_workflow_with_agents.py,06_functional_workflow_basics.py) andpython/samples/03-workflows/functional/(basic_pipeline, basic_streaming_pipeline, parallel_pipeline, hitl_review, steps_and_checkpointing, agent_integration, naive_group_chat)Docs work to do
WorkflowBuilder) API — when to pick which; both are supported@workflowusage, signatures with and withoutRunContext, and return/output semantics@step— what it does (result caching for HITL resume / crash recovery), when to use it (expensive operations: agent calls, API requests), and what happens without it (re-execution on resume)run(stream=True)) and event flowctx.request_info()including replay behaviorRunContextAPIs:request_info,add_event,get_state/set_state.as_agent()and its use casesReferences
python/samples/01-get-started/README.md,python/samples/03-workflows/README.md,python/samples/README.md