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.

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
- Open Automations and choose New.
- Choose When something happens in an app, then Gmail and the new-email event.
- Add a filter, such as Subject contains: demo, so the bot doesn't wake for every newsletter.
- 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.

Written by
Bhavik FuletraBhavik 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.




