A sequence diagram is a diagram that shows how participants, such as users, services or objects, exchange messages in a particular order. Each participant has a vertical line, time runs from top to bottom, and horizontal arrows show the messages between them. It is one of the interaction diagrams of the Unified Modeling Language, so it is often called a UML sequence diagram.
Sequence diagram symbols
Actor: a person or outside system that starts or takes part in the interaction, often drawn as a stick figure.
Participant or object: a box at the top of the diagram, such as "Web app" or "Payment service".
Lifeline: the dashed vertical line under each participant.
Activation bar: a thin rectangle on a lifeline that shows when the participant is busy.
Message: a solid arrow for a call or request, and a dashed arrow for the reply.
Fragments: labeled frames for logic such as
alt(alternatives),opt(optional) andloop(repetition).
When to use a sequence diagram
Sequence diagrams are useful when the order of communication matters: designing an API, explaining a login or payment flow, documenting how services call each other, or finding out where a request fails. They are also a clear way to explain a system to someone who does not read code.
How to draw a sequence diagram
Choose one scenario. For example "customer pays by card". One diagram per scenario keeps it readable.
List the participants. Place them left to right in the order they first take part.
Add the messages in time order. Label each arrow with the action or data it carries.
Add replies and conditions. Show return messages, and use fragments for alternatives and loops.
Check it against the real behavior. Walk through the diagram with the people who build or operate the system.
Example
A checkout flow has four participants: Customer, Store website, Payment gateway and Bank. The customer submits the order, the website sends a charge request to the gateway, the gateway asks the bank to authorize it, and the answer travels back along the same path. An alt fragment shows the two outcomes: payment approved, or payment declined with a message to the customer.
Sequence diagram vs flowchart
A flowchart shows the steps and decisions of a process. A sequence diagram shows who talks to whom, and in what order. A swimlane diagram sits between the two: it keeps the flowchart steps and adds a lane for each participant. For structure instead of behavior, use an architecture diagram or another UML diagram.
Sequence diagrams in MockFlow
Describe an interaction in plain words and the AI sequence diagram generator drafts the participants and messages on a MockFlow board, where you can edit them with your team. You can also start from the UML sequence diagram template or the payment checkout sequence skill. Engineering teams keep these diagrams beside their plans and notes on a whiteboard for developers.
