flowchart TD
Buffering["Buffering
append to batch"]:::transient
Sending["Sending
POST in flight"]:::transient
Success(["Success (2xx)"]):::terminalGood
ClientError(["Client Error (4xx)"]):::terminalBad
Backoff["Backoff
wait, then retry"]:::transient
OfflineQueue(["Offline Queue"]):::terminalBad
Buffering -->|flush or batch full| Sending
Sending -->|2xx| Success
Sending -->|4xx| ClientError
Sending -->|5xx or network error| Backoff
Backoff -->|on timer| Sending
Backoff -->|max retries exceeded| OfflineQueue
click Buffering call showStatePart("Buffering")
click Sending call showStatePart("Sending")
click Success call showStatePart("Success")
click ClientError call showStatePart("ClientError")
click Backoff call showStatePart("Backoff")
click OfflineQueue call showStatePart("OfflineQueue")
classDef transient fill:#4338ca,stroke:#312e81,color:#fff,font-size:15px,font-weight:bold
classDef terminalGood fill:#15803d,stroke:#14532d,color:#fff,font-size:15px,font-weight:bold
classDef terminalBad fill:#b91c1c,stroke:#7f1d1d,color:#fff,font-size:15px,font-weight:bold
linkStyle default stroke:#64748b,stroke-width:2px,font-size:12px
State Details
Click any state in the diagram to see what happens there, how long the state typically lasts, and which response codes drive its transitions.
Transient (Buffering, Sending, Backoff)
Terminal — success
Terminal — error / handoff