M2 · Modeling the domain
Use case
Section titled “Use case”Relay receives webhooks from many sources. You model the events and the job lifecycle
(queued → running → failed | succeeded, with retries) so illegal states can’t be written down,
parse every source into one event type at the edge, and make failures part of each function’s type.