State machine — HTTP/2 stream lifecycle (RFC 9113 §5.1)
The normative HTTP/2 stream state machine from RFC 9113 §5.1 — idle, reserved local/remote, open, half-closed local/remote and closed — with all twenty transitions labelled by the frame that causes them (HEADERS, PUSH_PROMISE, END_STREAM, RST_STREAM) and by whether it is sent or received.
Make it your own.
title "HTTP/2 stream states — RFC 9113 §5.1"
state Idle label "idle"
state ReservedLocal label "reserved local"
state ReservedRemote label "reserved remote"
state Open label "open"
state HalfClosedLocal label "half-closed local"
state HalfClosedRemote label "half-closed remote"
state Closed label "closed" final
initial Idle
transition Idle -> Open on "send HEADERS"
transition Idle -> Open on "recv HEADERS"
transition Idle -> ReservedLocal on "send PUSH_PROMISE"
transition Idle -> ReservedRemote on "recv PUSH_PROMISE"
transition ReservedLocal -> HalfClosedRemote on "send HEADERS"
transition ReservedLocal -> Closed on "send RST_STREAM"
transition ReservedLocal -> Closed on "recv RST_STREAM"
transition ReservedRemote -> HalfClosedLocal on "recv HEADERS"
transition ReservedRemote -> Closed on "send RST_STREAM"
transition ReservedRemote -> Closed on "recv RST_STREAM"
transition Open -> HalfClosedLocal on "send END_STREAM"
transition Open -> HalfClosedRemote on "recv END_STREAM"
transition Open -> Closed on "send RST_STREAM"
transition Open -> Closed on "recv RST_STREAM"
transition HalfClosedLocal -> Closed on "recv END_STREAM"
transition HalfClosedLocal -> Closed on "send RST_STREAM"
transition HalfClosedLocal -> Closed on "recv RST_STREAM"
transition HalfClosedRemote -> Closed on "send END_STREAM"
transition HalfClosedRemote -> Closed on "send RST_STREAM"
transition HalfClosedRemote -> Closed on "recv RST_STREAM"