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 with AI under Skill Lab's direction as an example. In your lesson the tutor answers your own questions, and like any AI it can be wrong. Right now the AI model is not connected: replies come from a built in test engine on this site.
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
Students can review a tutor after a paid lesson. Nobody has yet.
More like this
Other tutors on the same or nearby topics.