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.

Go to the course

What you'll see in this lesson

  1. Why automations break

    Almost no failure is your workflow's fault: an API fails, odd data arrives or the model replies with something unexpected.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

  6. 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.

  7. Test with sample data before publishing

    No change reaches production without first going through the same test cases, including the odd ones.

  8. 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.

  9. 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

Sign in with your Google account to access this lesson and the whole course.

Go to the courseSee the full syllabus

More lessons in this block