Module 1 — Foundations
Most automations are written for the happy path — the demo where the webhook fires once, the API is up, and the payload is shaped exactly right. Production is the set of all the other paths: the webhook that fires twice, the API that 500s, the rate limit you hit at 9:03am, the payload with a null where you expected a string. This module is the five disciplines that turn a happy-path script into something that survives a Monday.
1. Idempotency — the single most important property
Idempotent = running it twice has the same effect as running it once. Webhooks retry. Stripe, Calendly, HubSpot, and every queue you will ever touch deliver at-least-once, not exactly-once. That charge.succeeded event will arrive twice some day. If your workflow creates a deal on each delivery, you now have duplicate deals, double onboarding emails, and a confused customer.
The rule: every workflow that writes somewhere must be safe to run twice on the same input — via a natural upsert, a derived idempotency key, or a provider-side Idempotency-Key header.
2. Retries & backoff — failure is a state, not an exception
Classify the failure first. Retrying is only correct for transient errors (429, 500, timeout) — never for permanent ones (400, 401, 404). Use exponential backoff with jitter, cap the attempts, then dead-letter to a place a human watches. A workflow that retries forever is a workflow that fails silently.