Design an automation as an explicit recipe (trigger, conditions, actions, and failure handling) before you build it in whatever tool you are going to build it in.
Generate automation code from real-world recipes. Browse by platform or describe what you need. Covers cron jobs, GitHub Actions, AWS Lambda, shell scripts, and Terraform.
Select a recipe or describe your automation above...
Automations fail in production for reasons that are obvious in hindsight and invisible during design. The trigger fires twice because the upstream system retried, and the action runs twice. A step fails halfway through and leaves the system in a state neither the old nor the new one. Nobody is notified, so it stays broken for a week.
Idempotency is the property that solves the first problem and it has to be designed in rather than added later: use an idempotency key, or make the action naturally repeatable, so a duplicate trigger is harmless. For the second, decide explicitly whether a partial failure rolls back or resumes. For the third, alert on failure, and make sure someone is on the receiving end.