Describe a System Interaction Sequence
Purpose
Give designers, developers and testers one agreed picture of who talks to whom, in what order, with what contract and failure behaviour, for a specific scenario. It closes the gap between functional requirements and interface or API design.
When to use
- A user or business scenario spans two or more systems, services or external partners.
- Teams owning different systems need to agree on call order, synchronous vs asynchronous style and error handling.
- An incident or change needs the current interaction documented before redesign.
When not to use
- You need the full specification of one interface (fields, formats, SLAs). Use
integration-requirements or api-contract.
- You need the lifecycle of one entity. Use
state-model.
- You need the human business process across roles. Use
bpmn-model.
Inputs
Required:
- The scenario (trigger, goal, end state) and the systems or actors involved.
Optional, improves quality:
- Interface list or API specs, architecture context (e.g. a C4 container view).
- Non-functional expectations: latency, availability of partners, volumes.
- Known failure incidents or constraints (batch windows, rate limits).
If the scenario or the participating systems are unknown, ask for them, one question at a time. Everything else becomes [TBD] or an open question.
Process
- State the scenario: trigger, preconditions, success end state and the business outcome. One scenario per sequence; list variants separately.
- List participants left to right in call order: actor, front end, services, data stores that matter, external partners, message broker. Mark who owns each.
- Write the main success path as numbered messages: sender, receiver, operation or event name, sync (request/response) or async (event/queue), key payload fields and the response.
- Mark transactional and consistency boundaries: where data is committed, where eventual consistency starts, and what compensates if a later step fails (e.g. release stock, refund).
- For each synchronous call, define timeout, retry policy and idempotency key; for each asynchronous message, define delivery guarantee, ordering needs and duplicate handling. Unknown values become
[TBD].
- Add alternative and failure paths: partner down, timeout, business rejection, partial success, duplicate request, late response after timeout. Show what the user sees in each.
- Note security and data points: authentication between systems, personal data crossing boundaries (mask or minimize), audit or log entries.
- Label every behaviour not stated in the input
[ASSUMPTION] and list open questions with the owning team.
- Produce sequence diagram code (Mermaid sequenceDiagram or PlantUML) with alt/opt blocks matching the table.
- If the user wants to continue, suggest
integration-requirements or api-contract for each interface, error-scenario-catalog for the failure paths or state-model for entities whose status changes along the way.
Output format
# Sequence: <scenario>
Trigger: <...> · Preconditions: <...> · Success end state: <...>
## Participants
| Participant | Type (actor / service / store / partner / broker) | Owner |
|---|---|---|
## Main Flow
| # | From → To | Message / operation | Style (sync / async) | Key data | Response / result |
|---|---|---|---|---|---|
## Reliability Rules
| Step | Timeout | Retry | Idempotency / duplicates | Compensation |
|---|---|---|---|---|
## Alternative and Failure Paths
| Ref | Condition | Behaviour | User sees |
|---|---|---|---|
## Diagram
<Mermaid sequenceDiagram or PlantUML code>
## Assumptions and Open Questions
- [ASSUMPTION] ... — owner team
Quality checklist
Common pitfalls
- Drawing only the happy path. The value of a sequence lies in timeouts, retries and compensation, which is where teams disagree.
- Retrying non-idempotent calls such as payment capture. Require an idempotency key or a status query before retrying.
- Mixing several scenarios with nested alt blocks until nobody can read it. Split into separate sequences.
Example
Input: "Customer places an order: web shop calls order service, order service charges via payment gateway, reserves stock, sends confirmation email."
Excerpt of output:
| # |
From → To |
Message |
Style |
Key data |
Response |
| 1 |
Web shop → Order service |
createOrder |
sync |
cart, customerId, idempotencyKey |
orderId, status Pending |
| 2 |
Order service → Payment gateway |
authorize |
sync |
orderId, amount |
authCode or declined |
| 3 |
Order service → Broker |
OrderConfirmed |
async |
orderId, lines |
ack |
Failure path F1: payment gateway timeout after [TBD] s. Do not retry blindly; query payment status by orderId, keep order Pending, and show "Payment is being verified". [ASSUMPTION]: stock is reserved only after authorization.
1---2name: sequence-flow3description: "Describes how systems, services and actors interact in one end-to-end scenario: participants, ordered messages, sync or async style, payload essentials, responses, timeouts, retries and alternative or failure paths, delivered as a step table plus sequence diagram code. Use when a scenario crosses several systems, when integration behaviour must be agreed between teams, or when someone asks 'what calls what, in which order, and what happens if it fails?'."4license: MIT5metadata:6 source: https://skillmd.com/skills/muratdincer/sequence-flow7 version: "1.0.0"8 language: en9 category: 01-business-analysis10 role: system-analyst11 area: specification12 title: "Describe a system interaction sequence"13 related: "integration-requirements, api-contract, error-scenario-catalog, state-model, diagram-as-code"14 prompt: "Describe the sequence for an online order: web shop, order service, payment gateway, stock service and notification, including payment timeout."15---1617# Describe a System Interaction Sequence1819## Purpose20Give designers, developers and testers one agreed picture of who talks to whom, in what order, with what contract and failure behaviour, for a specific scenario. It closes the gap between functional requirements and interface or API design.2122## When to use23- A user or business scenario spans two or more systems, services or external partners.24- Teams owning different systems need to agree on call order, synchronous vs asynchronous style and error handling.25- An incident or change needs the current interaction documented before redesign.2627## When not to use28- You need the full specification of one interface (fields, formats, SLAs). Use `integration-requirements` or `api-contract`.29- You need the lifecycle of one entity. Use `state-model`.30- You need the human business process across roles. Use `bpmn-model`.3132## Inputs33Required:34- The scenario (trigger, goal, end state) and the systems or actors involved.3536Optional, improves quality:37- Interface list or API specs, architecture context (e.g. a C4 container view).38- Non-functional expectations: latency, availability of partners, volumes.39- Known failure incidents or constraints (batch windows, rate limits).4041If the scenario or the participating systems are unknown, ask for them, one question at a time. Everything else becomes `[TBD]` or an open question.4243## Process441. State the scenario: trigger, preconditions, success end state and the business outcome. One scenario per sequence; list variants separately.452. List participants left to right in call order: actor, front end, services, data stores that matter, external partners, message broker. Mark who owns each.463. Write the main success path as numbered messages: sender, receiver, operation or event name, sync (request/response) or async (event/queue), key payload fields and the response.474. Mark transactional and consistency boundaries: where data is committed, where eventual consistency starts, and what compensates if a later step fails (e.g. release stock, refund).485. For each synchronous call, define timeout, retry policy and idempotency key; for each asynchronous message, define delivery guarantee, ordering needs and duplicate handling. Unknown values become `[TBD]`.496. Add alternative and failure paths: partner down, timeout, business rejection, partial success, duplicate request, late response after timeout. Show what the user sees in each.507. Note security and data points: authentication between systems, personal data crossing boundaries (mask or minimize), audit or log entries.518. Label every behaviour not stated in the input `[ASSUMPTION]` and list open questions with the owning team.529. Produce sequence diagram code (Mermaid sequenceDiagram or PlantUML) with alt/opt blocks matching the table.5310. If the user wants to continue, suggest `integration-requirements` or `api-contract` for each interface, `error-scenario-catalog` for the failure paths or `state-model` for entities whose status changes along the way.5455## Output format56```markdown57# Sequence: <scenario>58Trigger: <...> · Preconditions: <...> · Success end state: <...>5960## Participants61| Participant | Type (actor / service / store / partner / broker) | Owner |62|---|---|---|6364## Main Flow65| # | From → To | Message / operation | Style (sync / async) | Key data | Response / result |66|---|---|---|---|---|---|6768## Reliability Rules69| Step | Timeout | Retry | Idempotency / duplicates | Compensation |70|---|---|---|---|---|7172## Alternative and Failure Paths73| Ref | Condition | Behaviour | User sees |74|---|---|---|---|7576## Diagram77<Mermaid sequenceDiagram or PlantUML code>7879## Assumptions and Open Questions80- [ASSUMPTION] ... — owner team81```8283## Quality checklist84- [ ] The sequence covers exactly one scenario with a clear trigger and end state.85- [ ] Every message has sender, receiver, style and response or acknowledgement.86- [ ] Every external or remote call has timeout, retry and duplicate handling defined or marked `[TBD]`.87- [ ] Each step that can fail after data was committed has a compensation or an explicit "none".88- [ ] Table and diagram contain the same messages in the same order.89- [ ] Inferred behaviour is labeled `[ASSUMPTION]`; personal data crossing boundaries is flagged.90- [ ] All checks pass; if any fails, revise the output and re-run this checklist before answering.9192## Common pitfalls93- Drawing only the happy path. The value of a sequence lies in timeouts, retries and compensation, which is where teams disagree.94- Retrying non-idempotent calls such as payment capture. Require an idempotency key or a status query before retrying.95- Mixing several scenarios with nested alt blocks until nobody can read it. Split into separate sequences.9697## Example98Input: "Customer places an order: web shop calls order service, order service charges via payment gateway, reserves stock, sends confirmation email."99100Excerpt of output:101| # | From → To | Message | Style | Key data | Response |102|---|---|---|---|---|---|103| 1 | Web shop → Order service | createOrder | sync | cart, customerId, idempotencyKey | orderId, status Pending |104| 2 | Order service → Payment gateway | authorize | sync | orderId, amount | authCode or declined |105| 3 | Order service → Broker | OrderConfirmed | async | orderId, lines | ack |106107Failure path F1: payment gateway timeout after `[TBD]` s. Do not retry blindly; query payment status by orderId, keep order Pending, and show "Payment is being verified". `[ASSUMPTION]`: stock is reserved only after authorization.