What Is an AI Workflow

Updated · 5 min read
easyPython 3.13aiworkflowsautomationhuman-reviewbusiness

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.

Fixed steps, AI in some of them, a person before sending
StepWho does itExample
1. TriggerThe systemA new email arrives
2. ExtractAIFinds the grade and the topic
3. ClassifyAIFees, admissions, urgent or other
4. DraftAIWrites a suggested reply
5. ReviewA personEdits and approves the draft
6. SendThe systemOnly 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:

Python
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}")
Output
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 approve

The 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:

  1. What makes something a workflow rather than an agent?
  2. Why did the urgent email skip the AI?
  3. Where should the human review step go?

Quick check: AI workflows

4 questions
1What is an AI workflow?
2In the example, what happens to an urgent email?
3Where should a person review the AI's output?
4What should happen if the AI step fails?

Key Takeaways

Quick reference

PartExample
TriggerA new email
AI stepsExtract, classify, draft
Human stepReview and approve
BranchesUrgent, failure

Was this tutorial helpful?

Lesson 73 of 186