Documentation Index
Fetch the complete documentation index at: https://allhandsai-redo-dynamic-workflow-mvp.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
A ready-to-run example is available here!
Overview
Dynamic workflows let a parent agent write a small Python script that coordinates sub-agents through a constrainedwf object. This is useful when the parent agent needs to keep intermediate results out of the main conversation while fanning out work across independent areas and then reducing the results into one answer.
The workflow script defines one entry point:
- run one sub-agent with
await wf.run_agent(...) - fan out across many inputs with
await wf.map_agents(...) - synthesize intermediate outputs with
await wf.reduce_agent(...) - flatten one level of nested values with
wf.flatten(...)
When to use dynamic workflows
Use dynamic workflows for tasks where the parent agent should create the orchestration plan at runtime, such as:- auditing test coverage across multiple project areas
- reviewing documentation quality by directory
- comparing several implementation strategies in parallel
- collecting independent findings and reducing them into a final report
Ready-to-run example
The example below asks the parent agent to write and run workflow code for a realistic test coverage audit. The parent agent owns the workflow tool; the generated workflow fans outcoverage_auditor sub-agents by project area and then reduces their findings into a repo-wide report.
examples/01_standalone_sdk/52_dynamic_workflow.py
The model name should follow the LiteLLM convention:
provider/model_name (e.g., anthropic/claude-sonnet-4-5-20250929, openai/gpt-4o).
The LLM_API_KEY should be the API key for your chosen provider.
