With our sequence markup tool, you can create and edit sequence diagrams with ease. Since Lucidchart auto-generates a sequence diagram from the text you enter, you can use the time you save to return to your code… or watch Star Wars.
Plan availability: Individual, Team, and Enterprise.
- Available on FedRAMP accounts.
- Read the Lucid Plans article for more information about what is available on your account or the Upgrade your Lucid account article for instructions to upgrade.
Watch: UML class diagrams
Create a sequence diagram with markup
Follow these steps, and Lucidchart will auto-generate a sequence diagram for you:
- Activate the UML shape library.
- Click More shapes at the bottom of the Shape menu on the left side of your document or press "M" on your keyboard.
- In the "Shapes" tab, check the box for the “UML” shape library.
- Click Use selected shapes.
-
Under the “UML Sequence” shape library in the Shape menu, click Use Markup.
- In the pop-over on the left-hand side, type your markup.
-
Click Build when you are ready to generate the diagram.
To create a new diagram, click Use Markup in the UML Sequence shape library again.
Tip: Save time by creating a sequence diagram with AI. Learn more in our Boost productivity with Lucid AI in Lucidchart article.
Supported markup
Lines
Lines represent a relationship between elements, helping visualize connections and flow within a system.
| Syntax | Description | Example |
|---|---|---|
|
Alice -> Bob Alice <- Bob |
Draw a solid line (you can draw lines in both directions). | |
| Alice --> | Draw a dotted line. | |
| Alice -> Alice | Draw a solid arrow to and from a participant. |
Lifelines
Lifelines show the participants involved in a process, representing how long each participant is active or involved during the events in the diagram.
| Syntax | Description | Example |
|---|---|---|
| activate Alice | Start participant activation with lifeline. | |
| deactivate Alice | End participant activation ending the lifeline. |
Arrows
Arrows represent the flow of communication between elements.
| Syntax | Description | Example |
|---|---|---|
| -> | Close arrow | |
| -> > | Open arrow | |
| - | No arrow |
Text
Text adds labels to lines in a diagram to add details to actions or flows.
| Syntax | Description | Example |
|---|---|---|
| Alice->Bob: text | Add a label to messages between participants. | |
| Alice->Bob: text\nmore | Add a label with a line break between participants. |
Notes
Use notes to add comments or explanations to a diagram, clarifying elements or processes.
| Syntax | Description | Example |
|---|---|---|
| note left of Alice: text1 | Add a note shape on the left of Alice (if there are only two characters, "of Alice" could be omitted). | |
| note right of Alice: text2 | Add a note shape on the right of Alice. | |
| note over Alice: text3 | Add a note shape displayed over Alice. | |
| note over Alice, Bob: text4 | Add a note shape displayed over Alice and Bob. | |
| note over Bob, Alice: This is an example of a long note \n with a line break. (keep this all in one line) | Add a note shape with multiple-lined notes, displayed over Alice and Bob. |
Grouping
Use grouping to visually organize related elements into a container, representing a physical or conceptual grouping in a system. This simplifies diagrams by showing the relationships among elements.
Lucidchart supports several grouping functions, each one having a different purpose. The following functions are supported:
- alt: represents alternative flows where only one path is chosen.
- opt: used for optional sequences that occur only if a condition is met.
- par: meaning parallel, allows actions to happen simultaneously.
- loop: represents repeated sequences.
- critical: defines a section that must be completed without interruption.
| Syntax | Description | Example |
|---|---|---|
|
alt successful case Bob -> Alice: data accepted else some kind of failure Bob -> Alice: data rejected end |
Build a grouping message with "alt" (alternative) and "else" to show different situations. | |
|
opt text1 Alice -> Bob: text2 end |
Build a grouping message with the keyword "opt". These keywords are supported:
Note: These four keywords don't support "else." Only the keyword "alt" can be paired with "else." |
|
Alias
Use an alias to assign an alternative name to an element, helping to simplify and organize your markup for better clarity.
| Syntax | Description | Example |
|---|---|---|
| participant A as Alice | Give participants aliases so you can write faster. | |
| participant A as "Alice Jones" | Put quotation marks around alias to give participant an alias longer than one word. |
Comments
Comments are a way to add notes within your code that are not displayed on the diagram. They provide helpful explanations or reminders without affecting the diagram’s structure.
| Syntax | Description |
|---|---|
| 'comment text | Single line comment |
| /' comment text '/ | Multiple line comment |
Edit a sequence diagram
Don’t worry if your sequence diagram isn’t perfect on the first try. You can still edit the markup of a diagram you have already built, as long as you have not manually adjusted or ungrouped the diagram on the canvas.
Simply click on the diagram, and the sequence markup dialogue will appear on the left side of the editor.
Style a sequence diagram
Select the sequence diagram, and use the Properties bar at the top of the editor to style your diagram. If you would like to style individual blocks/elements on your diagram, you must first ungroup the diagram. Select the diagram, right-click, and select Ungroup.
Note: If you ungroup your diagram, you will not be able to edit the markup again.
FAQ
Can I add styling syntax to my markup?
Styling UML syntax is not supported in Lucidchart. To learn more about styling your diagram, see the Style a sequence diagram section of this article.
Resources
To learn more about this feature, explore the additional resources below. These resources are available in English only.
Videos
Give feedback on this article
Have feedback about this article? Tell us about your experience here.