Playbooks

Start an AI agent when an email arrives

Set up an AI agent that starts work when a matching email lands in Gmail: pick the event, add a filter, choose the bot, and decide what it may send.

Bhavik Fuletra··2 min read
Start an AI agent when an email arrives: cover art with the Brainwrite team

To start an AI agent when an email arrives, connect your inbox, create an automation for a new email, and narrow it with a filter. Then tell a bot what to do with each match. In Brainwrite this is an app automation: Automations → New → When something happens in an app.

What it's good for

An email that always leads to the same few steps is a good fit. For example:

  • A demo request: research the sender's company and draft a reply with two call times.
  • An invoice from a supplier: check it against the purchase order and file it.
  • A support email with "refund" in the subject: pull the order and draft an answer.
  • A job application: summarise the CV for your hiring pipeline.

Step 1: connect Gmail

Connect Gmail once in Apps. It signs in through your browser, and tokens stay with the connection, never in prompts. Then give the bot that will do the work access to Gmail's tools. It can have all of them, an exact list, or none. See connected apps and Gmail.

Step 2: create the automation

  1. Open Automations and choose New.
  2. Choose When something happens in an app, then Gmail and the new-email event.
  3. Add a filter, such as Subject contains: demo, so the bot doesn't wake for every newsletter.
  4. Pick the bot, and say what it should do with each email.

You can also just ask the bot in chat: "When a new email with demo in the subject arrives, research the company and draft a reply." It sets up the same automation.

Step 3: decide what it may send

This step matters most. New bots start at Full access, which sends through your connected apps without asking. For an email automation you should:

  • choose Ask for approval for that bot, so each send waits for you; or
  • tell it to draft only, so replies land in Gmail's drafts.

The Automations list marks the ones that only read and draft.

Gmail is checked every 15 minutes. Apps that send events as they happen start the bot at once. Each automation shows when it last checked and what is next.

Step 4: let it run while you're away

Automations on your own computer need Brainwrite open. On Brainwrite Cloud they keep running while your computer is off. Each run reports into the bot's chat. If you edit the automation later, you can switch to another Gmail account, for example after reconnecting it.

Go further

  • Add Remember the last run so the bot knows which senders it already handled. See learning.
  • Pair it with a saved login when the next step happens on a website with no API.
  • Start from a ready-made job: inbox triage or sales follow-ups.
Bhavik Fuletra

Written by

Bhavik Fuletra

Bhavik Fuletra is the co-founder and CEO of Palzin LLC, the company behind Brainwrite. A tech entrepreneur and virtual CTO with more than 20 years in software and over ten products shipped, he works on SaaS architecture and the product decisions behind Brainwrite's AI agent teams. He is based in Ahmedabad, India.

FAQ

Questions people ask

How do I trigger an AI agent from a new email?

In Brainwrite, open Automations, choose New, then When something happens in an app. Pick Gmail and the new-email event, narrow it with a filter such as Subject contains, choose the bot and say what it should do. The bot starts on each matching email and reports into its chat.

How fast does an email automation start?

It depends on the app. Some apps send events as they happen, and the bot starts at once. Others, such as Gmail, are checked every 15 minutes. The Automations list shows when each one last checked and whether it found anything new.

Will the agent reply to emails without asking me?

It follows the bot's approval level. New bots start at Full access, which sends without asking. For email, choose Ask for approval for that bot, or tell it to draft only. Automations say which ones only read and draft.

Give your first job to Brainwrite.

Download the app, connect the AI you already pay for, and tell your Chief of Staff what needs doing.

macOS today. Windows and Linux are coming soon.