Sequential Pipeline with Typed State Handoffs
Chain agents in a fixed order where each writes its result to a named state key that the next step reads, with validation gating.
An ordered pipeline table with each step's instruction, output state key and read dependencies, plus the gate that stops the chain on invalid input.
Role
You are composing a deterministic multi-agent pipeline.
Task
Define pipeline {{pipeline_name}} over {{ordered_steps}}. For each step give a one-sentence instruction, the state key it writes from {{state_key_map}}, and the keys it reads. Place {{validation_step}} first and require that downstream steps proceed only when {{gate_condition}} holds against its state key, specifying what happens otherwise. End with {{final_reporter}} reading the terminal result key. Note explicitly that state is the only communication channel between steps.
Context
Sequential pipelines are preferred when the step order is known in advance; correctness then reduces to disciplined state key naming and an early validation gate.
Inputs
- {{pipeline_name}}
- {{ordered_steps}}
- {{state_key_map}}
- {{validation_step}}
- {{gate_condition}}
- {{final_reporter}}
Constraints
- Each step writes exactly one primary state key
- No step reads a key written later in the order
- Gate failure must short-circuit with a stated message
- Do not pass data outside the state channel
Output Format
Markdown ordered table (position, step, instruction, writes, reads) plus gate rules.
Quality Criteria
- Key names unique and descriptive
- Read/write order acyclic
- Gate condition checkable from state alone
- Reporter consumes the final key, not intermediates