+**`DynamicWorkflow`** launches several independent subagents in parallel, resumes existing subagents through `resume_agent_ids`, or combines both in one call. It always requires `description`, a short summary of the whole workflow. Each entry in `items` launches one new subagent: without `prompt_template`, every entry is a complete prompt on its own; with `prompt_template`, the template must contain the `{{item}}` placeholder and each entry replaces it. Item prompts must be distinct — duplicates are rejected. Pass `subagent_type` to choose the profile used by every spawned subagent, or omit it to use `coder`. Pass `model` and `effort` to run this workflow's subagents on a different model than the agent orchestrating them — a cheaper or faster model for mechanical work, for example; both apply to every subagent in the call, and omitting them falls back to the subagent profile's own settings and then to the calling agent's. A `model` the provider cannot resolve falls back to the calling agent's model rather than failing the run. Without `resume_agent_ids`, the tool requires at least 2 items; with `resume_agent_ids`, it can resume one or more existing subagents. The tool supports up to 128 total subagents, waits for all of them to finish, and returns an aggregated report. Workflow subagents have no automatic timeout; they run until completion, failure, or user cancellation. If a model response calls `DynamicWorkflow`, that call must be the only tool call in the response; to run several workflows, call one `DynamicWorkflow`, wait for its result, then call the next, or combine the work into a single workflow. In `manual` permission mode, `DynamicWorkflow` calls outside active Dynamic Workflow mode request approval unless a permission rule allows them; while Dynamic Workflow mode is active, `DynamicWorkflow` itself is auto-approved. Permission rules match `DynamicWorkflow` by tool name only — argument patterns such as `DynamicWorkflow(workflow)` are not supported.
0 commit comments