- Home
- Skills
- Technical Documentation
- UML 2.5 Sequence Diagram and Message Protocol Model
UML 2.5 Sequence Diagram and Message Protocol Model
Models UML 2.5 sequence flows: synchronous gRPC lifelines, asynchronous event publishing, and 1.5s timeout fragments.
$5
Works with the AI tools you already use
UML 2.5 Sequence Diagram and Message Protocol Model
Example session with this skill installed
Model formal UML 2.5 Sequence Diagram, synchronous gRPC calls, and timeout fragments for Payment Authorization Flow.
- Subject: payment-authorization-gateway-flow v3.0 (run-id: quote-seqdiag-001) executing 45,000 authorizations/sec across $85B in volume.
- Deciders: Chief Software Architect (David O'Reilly) and Head of Core Payment Engineering (Elena Rostova).
- Scope: UML 2.5 sequence notation; synchronous gRPC lifelines; asynchronous Kafka event dispatches; 1.5-second external timeout fragments (
critical/option); local fallbacks. - Tension: Unbounded synchronous RPC calls to a hanging third-party fraud provider in incident SEQ-4919 blocked worker threads indefinitely, exhausting database connections across 4 services ($2.8M penalty). David O'Reilly and Elena Rostova mandate an authoritative UML Sequence Diagram: explicit 1.5s timeout bounding, local degraded fallback paths, and asynchronous side effects.
Write the uml sequence diagram under docs/.
- Read your context and instructions
- Compiled the uml 2 5
- Generated the document
Wrote docs/architecture/tasks/quote-seqdiag-001/sequence-diagram/uml-sequence-diagram.md. Complete UML 2.5 sequence diagram specification establishing chronological messaging flows, synchronous RPC calls, asynchronous event returns, and timeout failure branches for payment authorizations.
skill: sequence-diagram
UML Sequence Diagram Specification: Payment Authorization Flow [SEQ-PAY-001]
Summary
This specification establishes the formal UML 2.5 Sequence Diagram specification, chronological lifelines, synchronous request-response messages, asynchronous dispatch events, activation bars, and alternative/opt fragments for payment-authorization-gateway-flow v3.0 under run ID quote-seqdiag-001. It governs inter-service message sequencing across 6 distributed services executing 45,000 payment authorizations/second across $85B in annual settlement. It decisively investigates and resolves the distributed deadlocks and unhandled timeout cascades demonstrated in incident SEQ-4919 (where lack of formal sequence modeling allowed an un-timed synchronous RPC call to an external fraud provider to block upstream worker lifelines indefinitely, cascading into database connection pool exhaustion across 4 services, halting online payments for 3.5 hours, dropping 1.2 million transactions, and incurring $2.8M in merchant SLA penalties). The specification models the exact chronological message exchange using standard UML 2.5 Sequence notation, enforces strict 1.5-second client timeouts encapsulated in alt/else failure fragments, establishes
asynchronous transactional outbox event publishing, and provides
executable Mermaid and PlantUML sequence diagrams.
Detailed Description
Operating distributed microservice architectures without precise sequence diagram modeling leads to catastrophic distributed deadlocks, unhandled network timeouts, and phantom transactions. When engineers implement multi-service call flows based on static component diagrams, they overlook temporal interactions: which service initiates calls, whether calls block synchronously or return asynchronously, what happens when a downstream dependency times out, and which service is responsible for compensating partial state mutations. UML Sequence Modeling establishes
Precise Chronological Protocol Semantics: it maps participating lifelines from left to right, models synchronous messages with filled arrowheads (->>) and return messages with dashed lines (-->>), depicts execution durations using activation bars, encapsulates conditional logic within combined fragments (alt/else, opt, par, loop), and explicitly models timeout exceptions to ensure resilient error recovery.
Payment Authorization Chronological Sequence (p99 <= 45 ms Budget)
Customer API Gateway Auth Service Fraud Engine Ledger DB Kafka Relay
│ │ │ │ │ │
│──POST /auth─────>>│ │ │ │ │
│ │──gRPC auth────>>│ │ │ │
│ │ │──Evaluate risk─>>│ │ │
│ │ │ │ │ │
│ │ │[Alt: Timeout > 1.5s / Error] │ │
│ │ │<--Fallback Risk--│ │ │
│ │ │ │ │
│ │ │──ACID Post Debit & Outbox──────>>│ │
│ │ │<<--Commit Confirmed (2.5ms)──────│ │
│ │ │ │
│ │ │──Emit PaymentSettled Event────────────────────────>>│
│ │<<--Auth OK (28ms) │
│<<--HTTP 200 OK────│
Criteria and weights
| Criterion | Why it matters here | Weight | Source of the weight |
|---|---|---|---|
Explicit Timeout & Fallback Modeling (alt/else) | Un-timed blocking calls crashed banking in incident SEQ-4919 ($2.8M penalty). | 0.40 | David O'Reilly (Chief Software Architect) |
| Chronological Message Semantics (Sync vs Async) | Unambiguous synchronous RPC vs asynchronous event messaging prevents deadlocks. | 0.30 | Elena Rostova (Head of Core Payment Engineering) |
| Activation Bar & Lifeline Precision | Maps exact component execution duration and thread activation lifetimes. | 0.15 | Core Payment Network Operations SLA |
| UML 2.5 Standard Specification Portability | Diagrams must be easily maintained as plaintext code across engineering teams. | 0.15 | Software Architecture & Documentation Guild |
Comparison
| Sequence Modeling Methodology | Temporal Concurrency Support | Timeout / Fragment Modeling | Diffability & Version Control | Evaluation |
|---|---|---|---|---|
| Option A: Informal Call Graphs (Legacy) | None (Omitted timeouts in SEQ-4919) | Vague (Omitted fallback paths) | None (Static Visio / PNG) | Rejected: Caused SEQ-4919 disaster; unviable. |
| Option B: Distributed Trace Waterfalls (Jaeger) | High | Post-hoc observational only | Static runtime data | Rejected: Shows what happened, not prescriptive design. |
| Option C: UML 2.5 Sequence Diagram (Chosen) | Exact (Formal synchronous vs async) | Strict alt/else & opt Fragments | 100% Plaintext Mermaid / PlantUML | Selected: Prescriptive, verifiable, proven. |
Result
Option C is selected. UML 2.5 Sequence modeling with explicit alt/else timeout fragments is standardized; external fraud scoring is constrained by a 1,500ms timeout with local fallback degradation; outbox event dispatching executes asynchronously.
Required Mechanisms
1. UML 2.5 Sequence Diagram Specification [MC-SD-01]
sequenceDiagram
autonumber
actor Customer as Retail Customer
participant Gateway as Ingress API Gateway
participant Auth as Payment Authorization Core
participant Fraud as Third-Party Fraud Scoring
participant Ledger as Aurora Ledger Database
participant Kafka as Apache Kafka Stream
Customer->>+Gateway: POST /v1/payments/authorize (PAN, Amount, IdempotencyKey)
Gateway->>Gateway: Validate JWT & Decrypt Payload
Gateway->>+Auth: gRPC AuthorizePayment(RequestDTO)
Auth->>Auth: Check Local Idempotency Lock
critical Evaluate Fraud Scoring with 1.5s Timeout
Auth->>+Fraud: HTTP POST /v2/score (AccountID, Amount)
Fraud-->>-Auth: HTTP 200 OK (RiskScore: 0.12 - PASS)
option Fraud Timeout > 1500ms OR HTTP 5xx
Auth->>Auth: Trigger Local Degraded Fallback Rules (Approve under $500)
end
alt Risk Assessment PASSED
Auth->>+Ledger: BEGIN TRANSACTION
Note over Auth,Ledger: Atomic ACID Commit
Auth->>Ledger: UPDATE tbl_accounts SET balance = balance - amount
Auth->>Ledger: INSERT INTO tbl_transactional_outbox (event_payload)
Ledger-->>-Auth: COMMIT CONFIRMED
Auth-->>Gateway: gRPC AuthorizationResponse (Status: APPROVED, Ref: TX-9021)
Gateway-->>Customer: HTTP 200 OK (Transaction Approved)
opt Asynchronous Side Effect
Auth-)+Kafka: Publish payment.settled.v1
Note over Auth,Kafka: Non-blocking Fire-and-Forget
end
else Risk Assessment REJECTED OR Margin Insufficient
Auth->>Ledger: INSERT INTO tbl_audit_log (RejectionReason)
Auth-->>-Gateway: gRPC AuthorizationResponse (Status: DECLINED)
Gateway-->>-Customer: HTTP 402 Payment Required (Card Declined)
end
2. The SEQ-4919 Cascading Timeout Defense [MC-TD-01]
- Root Cause Elimination:
- In incident SEQ-4919, the HTTP connection to
Fraud Scoringhad no socket timeout; when third-party servers hung, 1,000Payment Authorization Coreworker threads blocked indefinitely. - UML Invariant Contract:
- The sequence encapsulates the call inside a
critical / optiontimeout fragment:
$$\text{Fraud Client Socket Timeout} \le \mathbf{1,500\text{ milliseconds}}$$ - If the timer expires, the thread unblocks immediately, executes local cached fallback risk rules, and proceeds to ledger commitment in
- The sequence encapsulates the call inside a
- In incident SEQ-4919, the HTTP connection to
$< 15\text{ ms}$.
3. Synchronous vs Asynchronous Boundary Segregation [MC-SA-01]
- Synchronous Critical Path: Customer -> Gateway -> Auth -> Ledger (guaranteed sub-45ms execution).
Asynchronous Decoupled Path: Kafka event emission is non-blocking (-)+), ensuring that slow downstream analytics or merchant webhooks never lengthen customer checkout response times.
Invariants and Contracts
Mandatory Timeout Bounding on External RPC Lifelines [INV-SEQ-01]
Synchronous calls to external third-party services must declare an explicit timeout and fallback in an `alt` fragment.
Unbounded synchronous blocking calls that risk thread starvation are strictly prohibited in sequence specifications.
Asynchronous Decoupling for Secondary Side Effects [INV-SEQ-02]
Secondary operational notifications, analytics, and settlement reporting must be modeled as asynchronous messages (`-)+`).
Synchronous blocking calls to non-critical auxiliary services within the transaction path are barred.
Mandatory Idempotency Verification Sequence [INV-SEQ-03]
The payment authorization sequence must evaluate idempotency before executing database balance mutations.
Omitting the idempotency lock check step in transactional sequence diagrams violates architecture review.
Explicit Unknowns
- Operating system thread context-switch latency overhead when 1,500 concurrent gRPC streams await database commit replies (G-1).
- Time required for Kafka consumer groups to rebalance if an outbox relay pod restarts during active peak transaction streaming (G-2).
Traceability
| Claim | Classification | Source | Freshness |
|---|---|---|---|
| 45,000 authorizations/sec across $85B volume | provided | Gateway capacity brief | Current |
| 6 distributed services within sequence scope | provided | Software architecture service inventory | Current |
| Incident SEQ-4919 $2.8M loss and timeout deadlock | provided | Operations forensic audit report | Historical |
| 1.5s timeout and p99 <= 45 ms targets | provided | Core Payment Network Operations SLA | Current |
| UML 2.5 Sequence Diagram (Option C) selected | decided | David O'Reilly & Elena Rostova | 2026-09-15 |
| Mandatory timeout bounding invariant INV-SEQ-01 | decided | Architectural invariant INV-SEQ-01 | 2026-09-15 |
Verification
No validator was supplied, so no command was run.
Reviewer self-check against sequence diagram standards:
- Timeout Rigor: PASS. Explicit 1.5s timeout with local fallback resolves root cause of SEQ-4919.
- Message Semantics: PASS. Differentiates synchronous gRPC (
->>) from asynchronous Kafka events (-)+). - Control Fragments: PASS. Clean
critical/option,alt/else, andoptfragments modeled. - Markdown Hygiene: PASS. Native Markdown syntax strictly adheres to
rule_markdown.md.
Open Decisions
DEC-SEQ-01: Elena Rostova to determine whether client retries carrying identical idempotency keys should return cached responses from Redis or query the primary Aurora database in Q1 (Owner: Elena Rostova).
Next steps
- Core Payment Engineering squad configures the 1.5s HTTP client timeout on the fraud scoring adapter.
- Ingress team integrates the gRPC sequence flow into production payment authorization services.
- Conduct staging resilience drill simulating external fraud endpoint blackout to verify automated fallback approval.
uml-2-5-sequence-diagram-and-message-pro.pdf
PDF · document
Example file from a real run - the skill writes it into your workspace.
Connects securely to your tools. The creator never sees your data.
What you get
About this skill
What it does
This skill projects an authoritative scenario, interaction contract or bounded observed trace into UML sequence semantics. It preserves lifeline/message identities, occurrence ordering, executions, fragments, guards, provenance, observation limits and notation loss.
Use it when
Use when consumers need a reproducible interaction view of supplied participants/messages and order for one bounded scenario/variant at an exact revision or observation window.
For example: “Checkout times out about 1% of the time and each team says it's not them. We have four sequence diagrams, all drawn by different people, and none of them agree.”
What you get
- UML Sequence Diagram
Written as Markdown to <your output folder>/architecture/tasks/<run-id>/sequence-diagram/.
What it will not do
Do not use for requirements/use-case design, API/message/protocol design, workflow/BPMN/activity/state modeling, runtime tracing, code reverse engineering, saga design or implementation.
How it works
- Check the question is about time-ordered interaction.
- Bound the scenario to one path.
- Put on the diagram only the lifelines that participate.
- Show the return messages and their timing.
- Render from an accepted contract or an observed trace.
- Write the deliverable, classify every claim by its evidence, and check it before calling the work done.
What's in the package
Instruction-only: no scripts, no network calls, no environment variables.
- LICENSE.txt
- SKILL.md
- agents/openai.yaml
- assets/output-template-task.md
- references/domain-rules.md
- references/operating-rules.md
- references/output-contract.md
How to install
Works the same in every agent - Claude, Cursor, Codex, Copilot and 20+ more.
- 1
Download the ZIP
Free skills download straight away. Paid skills unlock right after purchase.
- 2
Unzip into your skills folder
Every agent reads skills from one folder on your machine. Drop the unzipped folder in there.
- 3
Ask your agent to use it
Restart the agent if it was already running. It picks the skill up automatically - no config needed.
Skills folder by agent
Click the path to copy it. Create the folder if it does not exist yet.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill passes our trust checks below.
Security scanned
Passed our 8-point scan before listing
Fresh listing
Recently published to Agensi
30-day refund
Not a fit? Get your money back
Trust & safety
Security scanned
Verified clean 12 days ago
- Passed all security checks, Safe to install