Multi-Agent Workflow Orchestration DAG Builder
Generate a declarative execution graph and orchestration script for coordinating autonomous agents and tool chains.
Use this template when designing multi-agent architectures that require structured handoffs, deterministic state transfers, and tool-calling dependencies. It produces an executable orchestration script and execution graph tailored to your runtime environment.
Role: Principal Agent Orchestration Engineer specializing in multi-agent workflow scheduling and runtime state management.
Context
- Deployment mission: {{agent_cluster_purpose}}
- Available tool endpoints: {{available_tool_apis}}
- Shared runtime state requirements: {{state_schema_requirements}}
- Resiliency and error constraints: {{error_handling_policy}}
- Target framework environment: {{target_runtime_framework}}
Task
Author a production-ready declarative workflow orchestration script that plans execution graph dependencies, manages agentic tool invocations, and handles state transitions across autonomous agent chains.
Method
- Parse the workflow scope from {{agent_cluster_purpose}} to identify discrete agent node boundaries.
- Map each agent node against the permitted endpoints specified in {{available_tool_apis}}.
- Define the shared execution payload and state mutation rules per {{state_schema_requirements}}.
- Establish dependency routing logic and conditional branch triggers across the agent network.
- Embed strict retry, fallback, and dead-letter queue operations based on {{error_handling_policy}}.
- Generate syntactically valid orchestration code tailored directly to {{target_runtime_framework}}.
- Configure telemetry hooks for agent thought traces and step-level latency monitoring.
Constraints
- MUST generate fully executable Python/YAML orchestration code without pseudocode abbreviations.
- MUST NOT permit circular agent delegation loops without an explicit hard-break counter.
- All tool signatures MUST strictly match types defined in {{available_tool_apis}}.
- Every state modification MUST preserve immutability outside explicit mutation hooks.
- Variable references must use the exact names provided in the context.
Output format
- Section 1: DAG Architecture Diagram (ASCII notation, max 20 lines)
- Section 2: Agent Node & Tool Interface Definitions (declarative code block)
- Section 3: Core Orchestrator Script (executable script with state machine)
- Section 4: Telemetry and Handoff Verification Plan (bulleted checklist, max 6 items)
Self-review
- Verify that all 5 variables are explicitly utilized and satisfied in the generated script.
- Check that no recursive loop conditions exist in the orchestration execution graph.
- Confirm the script strictly complies with the target syntax of {{target_runtime_framework}}.
Explicit role, a named task, and discrete steps the model can follow.
Background, inputs and variables the model needs before it starts.
Hard boundaries — what the model must and must not do.
A named, field-level shape for the response.
Ordered work items that force analysis before an answer.
Length and structure that travel across frontier models.
Signal density — instruction weight without padding.
Documented variables so the scaffold adapts to new inputs.
Quality bar, assumptions and behaviour when inputs are thin.
How much real usage the template has behind it.