# Mermaid state diagram in Markdown to PDF

Composite states with their own direction, choice and fork points, and notes map a lifecycle with many branches.

Composite states with their own direction, choice and fork pseudostates, start and end markers and notes, for the lifecycle of an insurance claim.

- PDF: https://legivel.com/examples/mermaid-diagrams/state-diagram.pdf
- Page: https://legivel.com/examples/mermaid-diagrams/state-diagram
- Open in the editor: https://legivel.com/markdown-to-pdf?sample=mermaid-state
- More mermaid diagrams in Markdown to PDF: https://legivel.com/examples/mermaid-diagrams

## Markdown source

````markdown
# State diagrams

```mermaid
stateDiagram-v2
    direction TB
    [*] --> Submitted
    Submitted --> UnderReview : documents complete
    Submitted --> MoreInformation : documents missing
    MoreInformation --> Submitted : customer replies
    MoreInformation --> Closed : no reply after 30 days

    state UnderReview {
        direction LR
        [*] --> Verification
        Verification --> Assessment
        Assessment --> Decision
        Decision --> [*]
    }

    state decision <<choice>>
    UnderReview --> decision
    decision --> Approved : within policy limits
    decision --> Referred : above the adjuster's limit
    decision --> Rejected : excluded by the policy
    Referred --> Approved : senior adjuster agrees
    Referred --> Rejected : senior adjuster declines

    Approved --> Paid : transfer sent
    Rejected --> Appealed : customer appeals within 60 days
    Appealed --> UnderReview
    Paid --> Closed
    Rejected --> Closed
    Closed --> [*]

    note right of Referred
        Claims above the adjuster's limit
        are decided by two people.
    end note
```

Every transition label, the nested review machine and the note are laid out automatically.
````
