Block V · Automation with AI · Lesson 25
Automations that don't break
You'll learn to design robust workflows: retries and error paths, operations that don't run twice, token limits per run, traces to know what happened and testing before publishing changes.
- 10 min
- 9 animated slides
- 4-question quiz
- Narrated in 6 languages
What you'll see in this lesson
- Why automations break
Almost no failure is your workflow's fault: an API fails, odd data arrives or the model replies with something unexpected.
- Retries with increasing waits
For a transient error, retry waiting twice as long each time, with some randomness, and never beyond a maximum of attempts.
- Error workflows: no failure goes unnoticed
When a step really fails, the workflow should take an error path that saves the case and alerts a person.
- Idempotency: no invoice or email sent twice
An operation is idempotent if repeating it doesn't change the result: the key is remembering what you've already processed.
- Put a cap on tokens and cost
Limit what goes into and out of the model on each execution and work out the cost before the bill tells you.
- Traces: knowing what happened at each step
A trace records each step of an execution: what went in, what came out, which tool was called, how long it took and how many tokens it used.
- Test with sample data before publishing
No change reaches production without first going through the same test cases, including the odd ones.
- Alerts: find out before your customer does
Set up alerts for what matters: repeated failures, a daily cost spike and queues that don't move.
- Summary
A robust workflow retries wisely, doesn't duplicate, caps its spending, leaves traces, alerts on patterns and is tested before publishing.
Tools and concepts
- Error workflows
- OpenTelemetry
- Evals
Sign in with your Google account to access this lesson and the whole course.