AI Workflows & Automation / Workflow Patterns
The shape of an automated workflow.
Reviewed by Yuvaraj
Nearly every automation platform, Zapier, Make, n8n, GitHub Actions, an internal job runner, is built on the same three-part model: a trigger starts a run, one or more conditions decide whether and how it proceeds, and a sequence of actions does the real work. Once you see this shape, unfamiliar tools stop looking like magic. You only have to ask three questions: what starts a run, what gates it, and what it does. This lesson walks through each part, the difference between event-driven and polling triggers, a quick look at cron, where an AI step fits, and a concrete email-triage example end to end.
A run is a single execution of a workflow. The trigger creates it and hands it an initial payload (the email, the webhook body, the new row). Conditions read that payload and decide the path. Actions then execute in order, each one able to use the outputs of the steps before it.
Ask about this lesson, or about anything in AI. Answers cite the lessons they draw on.
Finished this lesson?
Mark it complete to earn XP, keep your streak, and schedule a review.
Triggers come in two broad flavours. Event-driven triggers are pushed to you: an external system sends a request the instant something happens. Polling triggers are pulled: your workflow re-queries a source on a schedule and acts on whatever is new.
Schedule triggers use cron syntax: five space-separated fields, minute hour day-of-month month day-of-week. For example, 0 9 * * 1 means minute 0 of hour 9, on any day of any month, but only when the weekday is 1, that is, 09:00 every Monday. A * means "every value" for that field.
| Trigger type | Starts a run when... | Example |
|---|---|---|
| Webhook | an external system sends an HTTP request | Stripe posts a payment.succeeded event |
| Schedule (cron) | a clock matches a recurring expression | 0 9 * * 1 fires every Monday at 09:00 |
| Poll | a periodic check finds new data | every 5 minutes, query for new rows |
| Manual | a person clicks run or submits a form | an operator kicks off a backfill |
Conditions are the guard rails. They keep actions from firing on noise (spam, test payloads, records that do not match) and they let one workflow take different paths. A condition is usually a boolean test over the payload, and you can combine several with AND / OR. If nothing matches, the run simply ends without side effects.
Actions are the payload of the whole thing: send an email, upsert a database row, post to Slack, call a third-party API. An AI step is just another action.
An AI step is one action among many
Platforms treat a model call like any other action: it takes the run payload as input and returns structured output the following steps can use. You can drop classification, extraction, or drafting into an existing pipeline without redesigning it, and swap the model later without touching the trigger or conditions.
Goal: when a support email arrives, if it is not spam and is in English, classify its intent with an AI step and create a ticket plus an auto-reply.
The same workflow could also run on a schedule, say 0 9 * * 1, to sweep any messages that slipped through over the weekend.
Common mistakes