AI Steps Inside Workflows: Prompts That Behave
Write prompts for automation steps that return the same clean format every time, even on odd inputs
A taste of a lesson
My classification step usually returns 'Billing' but sometimes 'The category is Billing.' and my next step breaks. How do I fix it?
Two layers. First, the prompt: state 'Return only one of these exact labels: Billing, Delivery, Returns, Other. No other text.' and use a structured output option if your tool has one, with the label as an allowed value list. Second, validation: after the step, check the output exactly matches one label; if not, retry once with a note about the allowed labels, then send to review. That way an occasional chatty answer never reaches the next step. Does your tool offer a structured or JSON output setting for AI steps?
Written by the teacher as an example. In your lesson the tutor answers your own questions, and like any AI it can be wrong.
What you will be able to do
- Define a contract for each AI step: input, task, output and failure behaviour
- Write prompts with delimited input, edge case rules and fixed output formats
- Validate outputs and retry or route to review on failure
- Test prompts against empty, long, foreign language and adversarial inputs
- Version prompts and choose model size per step based on tests
Lesson plan
- 1 AI steps as components Think of each AI step as a contract with defined input, output and failure. Start
- 2 Writing the prompt Structure a short, tight prompt for an automation step. Start
- 3 Fixed output formats Get clean, parseable output every time. Start
- 4 Edge cases on purpose Test the step with inputs designed to break it. Start
- 5 Validation and retries Check every output and handle failures automatically. Start
- 6 Models, versions and changes Choose model size per step and change prompts safely. Start
Try asking
About this tutor
For people building workflows who add AI steps for summarising, classifying, extracting, rewriting or deciding. A prompt inside an automation is not a chat: nobody is there to rephrase, and the next step expects a precise format. You will learn to write prompts with tight instructions, fixed output formats, explicit handling of empty or strange inputs, low variability settings where available, and validation after the step. We also cover choosing smaller or larger models per step, keeping prompts versioned and tested, and protecting steps from instructions hidden in the data they process.
Reviews
4.5
2 ratingsSample
- Maya R.Sample
Testing with deliberately odd inputs was eye opening. One forwarded email chain broke everything before I added a rule for it.
- Ola B.Sample
The contract idea made my flows far more stable. The empty input rule alone fixed a weekly failure.
About the teacher
I teach operations teams to build AI automations for documents, requests and data that fail safely
9 tutors 316 lessons taught Sample
I work with operations teams who handle volume: invoices, support tickets, forms, contracts and meeting notes. My background is in finance operations and process improvement, so I think about accuracy, audit trails and what happens at month end when something quietly broke two weeks ago. I teach how to put AI steps inside workflows so that extraction, classification and summaries...
See Hamza's profile and tutorsMore like this
Other tutors on the same or nearby topics.