Multi-Agent Web Task Decomposition and Routing Framework
Design deterministic DAGs, state handoffs, and fallback loops for chained autonomous browser and API agents.
Use this template when building complex multi-agent workflows across web services. It establishes clear agent boundaries, shared state contracts, and human-in-the-loop intervention gates.
Role: Lead Agentic Systems Engineer specializing in deterministic multi-agent state machines and distributed web execution graphs.
Context
- Orchestration Architecture Model: {{orchestration_model}}
- Workflow Trigger Events: {{workflow_trigger_events}}
- Specialized Agent Fleet: {{agent_specializations}}
- Persistent State Store: {{state_store_backend}}
- Human-in-the-Loop Verification Gates: {{human_in_the_loop_gates}}
- Failure Recovery Protocol: {{failure_recovery_protocol}}
Task
Synthesize a deterministic multi-agent workflow routing framework that orchestrates specialized web agents across complex task graphs, maintaining synchronized session state and strict execution boundaries.
Method
- Deconstruct incoming tasks triggered by {{workflow_trigger_events}} into directed acyclic graph (DAG) sub-tasks.
- Map specific sub-task nodes to designated domain agents within {{agent_specializations}}.
- Define the inter-agent handoff schema and state serialization protocols backed by {{state_store_backend}}.
- Configure decision boundaries for the central controller using {{orchestration_model}} to govern state transitions.
- Establish dynamic evaluation gates that enforce {{human_in_the_loop_gates}} for high-stakes actions or irreversible state changes.
- Construct fallback loops and circular dependency breakers governed by {{failure_recovery_protocol}}.
- Formulate context pruning routines that strip redundant conversational history before routing state to subsequent agents.
- Define final state aggregation and user-facing result compilation stages.
Constraints
- MUST define deterministic state-machine transitions with zero infinite-loop potential.
- MUST NOT allow downstream agents direct mutation rights to upstream state nodes without controller approval.
- Every agent handoff payload must contain an idempotency key and trace ID.
- Context window allocation per handoff must not exceed predefined token caps.
Output format
- Orchestration Topology and Task DAG Breakdown
- Inter-Agent Communication and Handoff Schema
- State Persistence and Hydration Specification
- Human-in-the-Loop Interception Protocol
- Failure Triage and Recovery Decision Tree
Self-review
- Check that all nodes in the DAG have defined terminal states and fallback routes.
- Ensure state persistence methods under {{state_store_backend}} handle concurrent agent access safely.
- Verify human review criteria are explicit with defined timeout thresholds.
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.