This older article and its examples have not yet been reviewed against current APIs. Check the latest documentation before using the code or treating any example as a measured result.
The successful path is only part of an automation. Consider a webhook arriving twice, arriving late, or arriving with a required field that was not there before. Each case needs a response the next maintainer can understand.
Make failures and retries visible
Make the outcome of each step understandable to the person supporting it. Record the decision and enough context to investigate. Keep sensitive inputs and secrets out of the logs.
Give retries an explicit deduplication key so the same action is not applied twice. That matters when the action is sending an invoice.
Detect silence and document recovery
Watch for silence as well as errors. A scheduled job that stops running may not produce an error to alert you.
Document what triggers the workflow, who owns it, and how to undo its effects. Where there is no undo, provide a dry run.
Document what triggers the workflow, who owns it, and how to undo its effects. Where there is no undo, provide a dry run.