Skip to main content
Use WorkflowToolSet when a parent agent needs to coordinate several sub-agent calls in a Python workflow. For direct task delegation, start with TaskToolSet.

Coverage Audit Example

The parent writes a workflow with async def main(wf) and submits it to the workflow tool. The workflow uses wf.map_agents to audit four project areas with at most two concurrent sub-agents. It then uses wf.reduce_agent to combine their findings. Run this example from a checkout of OpenHands/software-agent-sdk: its prompt names that repository’s source and test directories. The audit inspects code and tests; it does not run the test suite or measure coverage percentages.
The auditor has terminal and file-editor tools. Its read-only instructions are prompts, not a sandbox restriction. Use a disposable checkout for this example.
examples/01_standalone_sdk/52_dynamic_workflow.py
You can run the example code as-is.
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.
ChatGPT Plus/Pro subscribers: You can use LLM.subscription_login() to authenticate with your ChatGPT account and access Codex models without consuming API credits. See the LLM Subscriptions guide for details.
The example limits the parent to six iterations. Increase max_iteration_per_run if it needs more turns to write and run the workflow. Each coverage auditor is instructed to use at most three inspection calls.

Next Steps