How to Build a Claude Automation Workflow for Your Business

Terminal-style cover showing a workflow from a new email or ticket, to Claude extracting and sorting it, to a person approving, then to the CRM, Sheets and a reply.

Every company has work that nobody enjoys and everybody repeats: reading incoming emails and forwarding them, copying details from forms into the CRM, writing the same kind of reply for the fortieth time this week. This is exactly the kind of work an AI workflow does well.

I build Claude-based automation workflows for day-to-day company work at Jinn Studios and for clients. The technology is the easy part. What makes a workflow useful is choosing the right process, deciding where a person stays in control, and measuring whether it actually saves time. This post walks through all of it, with code.

Workflow or agent?

These words get mixed up, so first a definition.

  • A workflow is a fixed series of steps that you design: when an email arrives, extract these fields, classify it, draft a reply, send it for approval. Claude does the reading and writing inside each step, but your code decides the order.
  • An agent decides its own steps. You give it tools and a goal and it chooses what to do next.

Most business automation should be a workflow. It is cheaper, faster, easier to test, and it does the same thing every time. Reach for an agent only when the steps really cannot be known in advance. (I cover agents in building a reliable AI agent with Claude.)

Step 1: Choose the right process

Good candidates have three things in common:

  1. They are repetitive. The same kind of task, many times a week.
  2. They are text-heavy. Emails, PDFs, forms, tickets, chat messages, reports.
  3. They follow a pattern a new employee could learn from a page of instructions and a few examples.

Some examples I see often:

ProcessWhat Claude doesWhat stays with a person
Shared inboxReads each email, pulls out the customer, the request and the urgency, routes itReplies to complaints and anything unusual
Lead intakeTurns website forms and emails into clean CRM records, flags duplicatesDeciding who to call first
Invoices and documentsExtracts supplier, amounts, dates and line items from PDFsApproving payments
Weekly reportsSummarises the week's tickets, sales notes or project updatesFinal review before sending

Avoid starting with work where a mistake is expensive and hard to notice, or where every case is different. Start small, prove it, then expand.

Step 2: Write down the process before automating it

Before writing code, write the instructions you would give a new employee: what to look for, how to decide, what good output looks like, and three to five real examples, including a tricky one. This document becomes the core of the prompt, and it often reveals that the process was never clearly defined in the first place.

Step 3: Get structured output, not free text

The single most important technical decision is to make Claude return structured data that your code can check, not a paragraph your code has to guess at. The Anthropic SDK can validate the response against a schema for you.

Here is the core of an inbox triage step in Python:

python
from typing import Literal

import anthropic
from pydantic import BaseModel, Field

client = anthropic.Anthropic()  # reads ANTHROPIC_API_KEY from the environment


class Triage(BaseModel):
    customer_name: str | None
    company: str | None
    request: str = Field(description="One sentence: what the sender wants")
    category: Literal["new_lead", "support", "billing", "supplier", "spam", "other"]
    urgency: Literal["low", "normal", "high"]
    confidence: float = Field(ge=0, le=1, description="How sure you are about the category")
    draft_reply: str | None = Field(description="A short reply for support or new_lead, else null")


INSTRUCTIONS = open("triage-instructions.md", encoding="utf-8").read()  # the document from step 2


def triage(email_text: str) -> Triage:
    response = client.messages.parse(
        model="claude-opus-5-5",
        max_tokens=16000,
        output_config={"effort": "medium"},
        system=INSTRUCTIONS,
        messages=[{"role": "user", "content": f"<email>\n{email_text}\n</email>"}],
        output_format=Triage,
    )
    return response.parsed_output

response.parsed_output is a validated Triage object. If the category is not one of the allowed values, it fails here, not three systems later in your CRM.

Step 4: Keep a person in the loop where it matters

Not every step needs a human, and requiring approval for everything defeats the purpose. Decide per action:

  • Safe to automate fully: sorting, tagging, routing, filling internal fields, summarising.
  • Draft, then approve: anything a customer will read, anything that changes money, anything that cannot easily be undone.
  • Never automate: decisions that need judgement, empathy or legal responsibility.

Use the confidence score to send unclear cases to a person:

python
def handle(email_text: str) -> None:
    result = triage(email_text)

    if result.category == "spam" and result.confidence > 0.9:
        archive(email_text)
    elif result.confidence < 0.7 or result.urgency == "high":
        send_to_review_queue(email_text, result)  # a person decides
    else:
        create_crm_record(result)
        if result.draft_reply:
            save_draft_for_approval(result)  # a person clicks send

    log_decision(email_text, result)  # every decision is traceable

The thresholds are a starting point. Tune them on real data.

Step 5: Connect it to the tools you already use

A workflow is only useful if it lives where the work happens. Common triggers and destinations:

  • Triggers: a new email (Gmail or Outlook webhooks), a form submission, a new row in a spreadsheet, a file dropped into a folder, a schedule.
  • Destinations: your CRM, helpdesk, Google Sheets, Slack or Teams, accounting software, or a database.

Most of these have APIs or webhooks. The workflow can run as a small serverless function: I described one way in serverless AI on AWS with Bedrock and Lambda, which also keeps the data on your own cloud account.

Step 6: Test it before you trust it

Collect fifty to a hundred real past examples (with personal data removed if needed) and the correct answer for each. Run the workflow on all of them and compare. This small test set:

  • tells you how accurate the workflow really is before it goes live,
  • shows exactly which kinds of cases it gets wrong, and
  • lets you check that a change to the prompt made things better, not just different.

Run it again whenever you change the instructions or the model.

Step 7: Measure the time saved

Decide what success means before launch. Useful measures:

  • Time per item before and after, for example minutes spent per email or per invoice.
  • Share handled without a person, and how often a person corrected the result.
  • Speed of response to customers or leads.
  • Errors caught in review.

Log every decision and every human correction. The corrections are the best source of new examples for the instructions.

Mistakes I see often

  • Automating a process nobody has defined. The AI makes the confusion faster, not better.
  • Free-text output parsed with string matching. Use structured output.
  • No logs. When something goes wrong, you need to see what the AI saw and what it decided.
  • Sending customer messages without review in the first weeks.
  • Trying to automate the whole department at once. Start with one process.

Summary

Pick one repetitive, text-heavy process. Write down how it is done. Use structured output, keep a person on the risky steps, connect it to your existing tools, test it on real examples and measure the result. Then do the next one.

If you have a process that eats hours every week, I build AI automation workflows around Claude and connect them to the tools you already use. Tell me what you would like to automate.

Have something in mind?

Tell me what you need in a couple of lines. I reply quickly with questions, an estimate and next steps. No prices on the site, no obligation.

Message me on WhatsApp Email me

available for work
WhatsApp me (opens WhatsApp in a new tab)