Lesson 3 of 5, 15 min with the exercise
Connect the steps
Make the AI's output usable by the next step.
A trigger starts the process: a new email, a form, a row in a sheet. An automation tool then passes data from step to step.
Prose breaks this chain, so ask the model for a fixed structure with allowed values.
Read the email and return only this JSON:
{
"category": "billing" | "technical" | "other",
"urgent": true | false,
"summary": "one sentence"
}
If you're unsure, use "other".Then have your workflow validate the result. If a field is missing or the value isn't on the list, send the item to a person instead of passing it on. Give every run an ID, so you can trace what happened to any item.
See it in practice
Plan for bad output from day one. Decide what happens when the model returns "Billing" instead of "billing", adds a sentence before the JSON, or the service times out. A sensible default is one retry, then send the item to a person with the error attached. Nothing should disappear silently.
Common mistake: Testing only the normal path. Most production problems come from missing fields, odd formats and timeouts.
Try it
Write the exact output format for your AI step, and run it on ten real inputs. Count how many would have passed validation.
You're done when
- The output has a fixed format
- Invalid output goes to a person
- You can trace any item by its run ID