Starbase / 02 RecipeAgents

RecipeAgents / Guides

Agent recipe guide

AI email triage agent

An email triage agent reads each new message, decides what kind it is, and does the boring part for you: labeling, drafting a reply, and collecting urgent items into a digest. You stay in control because nothing is sent automatically.

This recipe uses Gmail, Zapier or Make, and a ChatGPT (OpenAI) step. It takes an afternoon to set up.

The prompt

Classify this email as URGENT, REPLY, FYI or JUNK. Return JSON {label, reason, draft_reply}. Draft only if REPLY: under 120 words, my tone is direct and friendly. Email: {{body}}

Step by step

  1. Trigger: new email in Gmail (filter out newsletters and your own sent mail).
  2. Send subject and body to an OpenAI step with the prompt above.
  3. Parse the JSON and apply the returned label in Gmail; for REPLY, save draft_reply as a Gmail draft on the thread.
  4. Schedule a daily 8am step that collects URGENT emails and posts a digest to Slack.
SPONSOR SLOT · AVAILABLEFeature your product here

Why JSON output

Asking for JSON with fixed keys makes the model's answer machine-readable, so Zapier or Make can route on the label without fragile text parsing. The 'reason' field is there for you: when a label looks wrong, it tells you why the model chose it, which is how you improve the prompt.

Tuning the labels

Run it for a week in 'label only' mode before turning on drafts. Look at mislabeled emails and add a line to the prompt for each pattern, such as 'Invoices from vendors are FYI unless overdue.' Keep the list of labels short; four is enough for most inboxes.

Mistakes to avoid

Auto-sending drafts. Keep drafts as drafts.

Sending every email to the model, including marketing mail. Filter first to save cost and noise.

Ignoring privacy: check your company's policy before sending email content to a third-party AI service.

Build it in Make, Zapier or n8n

The recipe is tool-agnostic. Every step maps to a standard building block: a trigger from the app where the data starts, an AI step that sends text to a model with the prompt, a parser that reads the JSON or text that comes back, and actions in the destination apps. Zapier is the quickest to get running for linear flows. Make makes branching and loops easier to see. n8n can be self-hosted if you want to keep data on your own infrastructure. Pick the one your team already pays for.

Test it before you trust it

Run the recipe on ten to twenty real examples before you switch it on for everything. Put the inputs and outputs side by side in a sheet and mark each one right or wrong. Where it's wrong, add one specific line to the prompt that addresses the pattern, then run the same examples again. Keep a human approval step on any action that is visible to customers or touches money until the error rate is one you'd accept from a new hire.

Watch running costs as well. Each AI step is billed by the model provider and each task or operation by the automation tool. Filtering inputs before the AI step, for example skipping newsletters or tiny files, is the easiest way to keep both down. Check current pricing on each vendor's site, since it changes often.

Before you use it

Every recipe on RecipeAgents follows the same shape: a trigger, the tools, the steps, and the exact prompt. Start with the human-approval version. Once you have watched a few dozen runs and trust the output, decide which steps can run on their own. Model and tool names change often, so check current pricing and features in each tool before you build.

Frequently asked questions

Can Zapier triage Gmail with AI?
Yes. A Gmail trigger, an OpenAI step with a classification prompt, and Gmail actions for labels and drafts are all you need.
Make or Zapier for this?
Either works. Make is handy if you want branching on the label inside one scenario; Zapier is quicker for simple linear steps.
Will it send emails for me?
Not in this recipe. It saves drafts, and you review and send.

More guides

Back to all of RecipeAgents

Newsletter

Get one new agent recipe every week

Free. No spam. Unsubscribe anytime.