Multi-Agent Workflow State Transition Rewrite and Handoff Memo
Standardizes inter-agent communication protocols and state schemas for complex workflow chains.
Deploy this template when multi-agent workflow handoffs suffer from payload drift, dropped state variables, or ambiguous agent termination conditions. It writes an executive engineering handoff email containing rewritten transition prompts and state validation logic.
Role: Staff Agentic Systems Engineer specializing in orchestration graph topology and deterministic chain execution.
Context
- Orchestration Framework: {{orchestration_framework}}
- Source Chain Definition: {{source_chain_definition}}
- Handoff Friction Points: {{handoff_friction_points}}
- State Schema Draft: {{state_schema_draft}}
- Latency SLA Target: {{latency_sla_target}}
- Target Stakeholders: {{target_stakeholders}}
Task
Generate a comprehensive technical rewrite email addressed to {{target_stakeholders}} that refactors the inter-agent transition prompts, context-passing schemas, and termination signals across {{source_chain_definition}} within {{orchestration_framework}}.
Method
- Deconstruct {{source_chain_definition}} to locate semantic payload degradation and dropped keys identified in {{handoff_friction_points}}.
- Rewrite the node-to-node context condensation prompts to enforce strict state retention against {{state_schema_draft}}.
- Clarify handoff conditions between upstream worker agents and downstream evaluator agents.
- Design concise, unambiguous halt/continue boolean flags to prevent agent deadlocks and cyclical handoffs.
- Audit rewritten transition prompt lengths to ensure execution remains compliant with {{latency_sla_target}}.
- Standardize error-recovery instructions for downstream nodes when receiving partially formed states.
- Compile the rewritten handoff prompts into a structured technical update email.
Constraints
- MUST preserve all immutable state variables specified in {{state_schema_draft}}.
- MUST define explicit fallback branches for failed agent handoffs.
- MUST NOT introduce non-standard serializations outside JSON or structured Pydantic models.
- Limit body copy to high-signal technical explanations with clear code/prompt blocks.
Output format
An email structured with the following sequence:
- Subject Line: [Architecture Update] State Transition & Handoff Optimization for {{source_chain_definition}}
- Problem Context & Friction Analysis (max 4 bullets)
- Node Handoff Rewrites (Specification per agent boundary: Upstream Prompt, State Diff, Downstream Parser)
- Deadlock & Loop Prevention Protocol
- Latency & SLA Impact Estimate
- Implementation Sign-Off Checklist
Self-review
- Do all agent handoffs specify non-ambiguous exit conditions?
- Does the revised state schema prevent context bloat during recursive loops?
- Are the technical changes achievable within the {{latency_sla_target}}?
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.