This sample follows one order through a serverless pipeline on AWS: API Gateway receives it, a small Lambda function validates it and drops it on an SQS queue, and a second Lambda function processes the queue in batches and stores the result in DynamoDB. Messages that keep failing are moved to a dead-letter queue (DLQ) and raise an alarm. The diagram shows both the happy path and where failures go.
This is an event-flow (architecture) diagram. UML covers software structure and behaviour; event-flow diagrams are the companion notation for asynchronous cloud pipelines, and the variant below shows the same flow as a UML sequence diagram.
1. The diagram
Request. The client sends POST /orders. API Gateway authenticates it and invokes the ingest function (Lambda proxy integration).
Validate. The ingest function checks the payload, rejecting bad input with a 400, so junk never reaches the queue.
Enqueue. It calls SendMessage and returns 202 Accepted straight away. The client does not wait for processing.
Consume. Lambda's event source mapping polls SQS and invokes the process function with up to 10 messages per batch, scaling out as the queue grows.
Store. Each order is written with a conditional PutItem, so a duplicate delivery cannot create a second order.
Fail safely. The function reports only failed message ids back. Those messages become visible again after the visibility timeout; after the third failed receive, SQS moves them to the DLQ, and a CloudWatch alarm notifies on-call through SNS.
2. How to read it
Read left to right for the happy path, then follow the red dashed arrows downward for failures. The queue is the key element: everything to its left is synchronous and fast, everything to its right is asynchronous and retried.
3. Variant: the failure path as a sequence diagram
The architecture view shows where a failed message goes; a UML sequence diagram shows when. The loop [x3] combined fragment makes the retry count explicit, and it is clear that the client already has its 202 long before the failure happens, which is exactly why the DLQ alarm is needed.
4. Pros, cons, and when to use
Pros
Separates the synchronous edge from asynchronous processing at a glance.
Makes retry and dead-letter routes visible instead of hidden in configuration.
Each box maps to one deployable resource in SAM, CDK or Terraform.
Helps size timeouts, batch sizes and concurrency limits.
Easy for non-specialists to follow left to right.
Cons
Timing, ordering and duplicate delivery are not visible (use the sequence variant).
IAM permissions, which cause many real failures, are not shown.
Fan-out with many consumers quickly becomes a tangle.
Vendor-specific names make it harder to compare with other clouds.
When to use
Designing or reviewing any queue-based or event-driven pipeline.
Runbooks: on-call engineers need to know where failed messages end up.
When not to use
Long multi-step workflows with branching; a Step Functions state machine or BPMN diagram is clearer.
Explaining the data model of the table (use an ER diagram).