What Is an AI Workflow
How could the school office answer 200 emails a week without hiring anyone? Campus Helper handles questions on the school's website, but parents still email the office directly. Srihitha sketches a plan: every new email is read, sorted and given a draft reply by AI, and a person approves each reply before it goes out.
That plan is an AI workflow. This lesson explains what a workflow is, where AI fits in it, and where people must stay in charge.
A Workflow Is a Sequence of Tasks
An AI workflow is a fixed sequence of connected tasks, where AI does some of the steps. The steps are designed in advance, and they run the same way every time.
| Step | Who does it | Example |
|---|---|---|
| 1. Trigger | The system | A new email arrives |
| 2. Extract | AI | Finds the grade and the topic |
| 3. Classify | AI | Fees, admissions, urgent or other |
| 4. Draft | AI | Writes a suggested reply |
| 5. Review | A person | Edits and approves the draft |
| 6. Send | The system | Only after approval |
The Workflow in Python
This small program shows the structure. A simple keyword rule stands in for the AI classifier, so the routing is easy to see:
emails = [
"Hi, what is the lab fee for grade 10?",
"When is the admission deadline for next year?",
"URGENT: my child was hurt at school today",
"Can I get a refund for the field trip?",
]
def classify(text):
"""Step 2: a simple keyword classifier, standing in for an AI model."""
text = text.lower()
if "hurt" in text or "urgent" in text:
return "urgent"
if "fee" in text or "refund" in text:
return "fees"
if "admission" in text:
return "admissions"
return "other"
def draft_reply(category):
"""Step 3: a draft reply; in a real workflow an AI model writes it."""
return {"fees": "Thanks for asking. Here is our current fee schedule...",
"admissions": "Thanks for your interest. Admission deadlines are..."}.get(category)
for email in emails:
category = classify(email)
draft = draft_reply(category)
if category == "urgent":
route = "sent straight to a person: no AI reply"
elif draft is None:
route = "no draft: a person writes the reply"
else:
route = "draft waits for a person to approve"
print(f"{category:<10} | {route}")fees | draft waits for a person to approve
admissions | draft waits for a person to approve
urgent | sent straight to a person: no AI reply
fees | draft waits for a person to approveThe urgent email never reaches the AI. Deciding where people must be involved is part of designing the workflow, not an afterthought.
Common Mistakes
Letting AI send replies automatically. Keep a person approving outgoing messages, at least until the workflow has proven itself.
Forgetting the failure path. Decide what happens when the AI fails or is unsure.
Sending sensitive cases through AI. Route urgent or high-risk messages straight to people.
Interview Corner
What is an AI workflow?
A fixed sequence of connected tasks in which AI performs some steps, such as extracting, classifying or drafting, usually with a human review before any output leaves the organization.
Where should human review go in an AI workflow?
Before any irreversible or outward-facing action, such as sending a message or making a payment, and for sensitive cases, which should bypass the AI entirely.
Practice
Exercise: design your workflow. Pick a repetitive task with incoming messages, such as club sign-ups or customer questions. Draw its steps from trigger to final action, mark which are AI steps, where the person reviews, and what happens for urgent cases and failures. Then add a fifth email to the Python example that should go to "other", and check the route.
Check your understanding:
- What makes something a workflow rather than an agent?
- Why did the urgent email skip the AI?
- Where should the human review step go?
Key Takeaways
Quick reference
| Part | Example |
|---|---|
| Trigger | A new email |
| AI steps | Extract, classify, draft |
| Human step | Review and approve |
| Branches | Urgent, failure |
Was this tutorial helpful?