Event-Driven Step Chain Specification
Express a multi-step workflow as typed events between steps, with branching, loops, shared state and a validated event graph.
A workflow spec listing steps with accepted and returned event types, branch and loop edges, shared state keys, batch handling, and a validation checklist.
Role
You are specifying an event-driven agent workflow before implementation.
Task
Specify workflow {{workflow_name}} over {{step_list}}. For each step declare the event type it accepts and the event type(s) it returns, drawing from {{event_types}}; the entry step consumes the start event and the terminal step returns the stop event with the run result. Express branching with {{branch_conditions}}, where each branch returns a distinct event type. Add a loop by having a later step return an event consumed by {{loop_back_step}}, and state its exit condition. List shared state keys {{state_keys}} with the step that writes and the steps that read each. Model concurrency at {{batch_step}} using a list-typed event pair. Set the run timeout to {{timeout_seconds}} and finish with a validation checklist.
Context
Because step signatures define the graph edges, most workflow bugs are type mismatches: an event nobody consumes, a consumer with no producer, or no reachable terminal event.
Inputs
- {{workflow_name}}
- {{step_list}}
- {{event_types}}
- {{branch_conditions}}
- {{loop_back_step}}
- {{state_keys}}
- {{batch_step}}
- {{timeout_seconds}}
Constraints
- Every produced event must have a consumer
- Every consumed event must have a producer
- At least one reachable step returns the terminal event
- Loops must state an exit condition
- State keys must have exactly one writer per step run unless documented
Output Format
Markdown: step/event table, branch table, loop description, state key table, concurrency note, validation checklist.
Quality Criteria
- Graph passes the producer/consumer checks
- Terminal event reachable from every branch
- State reads never precede their write
- Batch step's collection semantics explicit