Writing every reply to an inquiry from scratch takes time, yet letting AI send replies on its own feels risky. This article is for the staff who handle inquiries, and explains how to keep the reply AI writes as a Gmail draft so that a person reads it before sending.
Summary
To have AI write drafts, use a Samurai App workflow. It starts when Gmail receives mail, writes the text with "Generate with AI", and saves it as a Gmail draft with "Run external service". A person does the sending on the Gmail screen.
You can also read email in Channels, but "AI reply" is not available in email rooms.
| Workflow | Channels (/channels) |
|
|---|---|---|
| AI draft | Saved as a Gmail draft | Not created in email rooms |
| Target | Email matching the search conditions | The categories chosen in "Email to bring in" |
| Where you send | The Gmail screen | The room's input box ("Send externally") |
If you write the text yourself and want to read email and chat in one place, Channels is the better fit.
What it can and cannot do
You can set it up so nothing is sent. The operation used is GMAIL_CREATE_EMAIL_DRAFT, which only creates a draft. Do not choose the similarly named GMAIL_REPLY_TO_THREAD, which actually sends.
To attach the draft to the thread, leave the subject empty. Passing thread_id makes the draft part of that thread, but entering a subject starts a new thread. An invalid thread_id does not fail; the draft goes into a new thread instead.
Watch out for email where the sender and the reply-to address differ. The fields that arrive at the start do not include Reply-To, only sender. For email forwarded from an inquiry form, sender is the form's address, and the real address to reply to is in the body. In that case, fix the draft's recipient before sending.
The email body was written by someone outside the company. "Generate with AI" has no tools and answers only once, so even if the body contains text that looks like instructions, it cannot operate on your email. It can, however, influence the text of the draft. That is why a person reads it before sending.
The Gmail trigger can be up to 15 minutes late. A draft does not appear the moment mail arrives.
What you need
- The Gmail account that receives inquiries, and its connection in Samurai App's "Connectors"
- Your reply policy: pricing, delivery dates, when to hand off to a staff member, and other limits on what AI may write
- Permission to add service integrations to workflows (manager or above)
Steps
1. Connect Gmail
On the "Connectors" screen, "Add" Gmail and link it with the account that receives inquiries. Adding a connector is an operation for admins and managers. Drafts are created in the connected account, so if someone else creates the trigger, pin the account with "Lend to this workflow" under "Credentials used to run" in the operation step.
2. Add a step that writes the text
Create a workflow with "New", and in "Workflow input" add a field named event with the type "Group of fields".
Add "Generate with AI" from "Think", and write in "Instructions":
Write the body of a reply to the following inquiry email.
- Be polite and concise. Do not write a salutation or signature
- Do not mention pricing or delivery dates; say a staff member will get back to them
- If you do not know something, say so
Subject: {{input.event.subject}}
Body: {{input.event.message_text}}
If you do not add "Output fields", the result is passed to the next step as <step name>.text.
3. Add a step that saves the draft
Add "Run external service" from "Connect" and choose GMAIL_CREATE_EMAIL_DRAFT.
| Name | Value |
|---|---|
recipient_email |
{{input.event.sender}} |
body |
Choose text from step 2 with "/" |
thread_id |
{{input.event.thread_id}} |
Do not fill in subject. To add a signature, add include_signature.
Creating a draft is a write that runs in an unattended run. By default it runs without showing an approval card and is recorded in the approval history. If an admin has set this operation to "Confirm every time" or "Forbidden", it is refused.
4. Publish and add the trigger
"Save", then press "Publish version N" on the "Versions" tab. On the "Triggers" tab, choose Gmail with "Add service integration", and in "When to run" choose "New Gmail Message Received Trigger". Narrow it to inquiries with query under "Filter".
to:support@example.com -from:me
If you do not filter, a draft is created for every email received, at a cost of about 0.5 yen each.
5. Read the drafts and send them
Open "Drafts" in Gmail, check the recipient and body, and send. Discard the ones you do not need.
If sales email and the like get mixed in, place "Classify by category" from "Flow" before "Generate with AI" so that only inquiries go further.
Reading and replying in Channels
Link your own Gmail with your own account at /settings/connections, then press "Connect this Gmail" from "Connect your own account" in Channels.
- "Email to bring in" defaults to "Primary" only
- A room is created for each sender, and AI applies the labels "Needs action", "Awaiting reply", or "FYI only"
- The recipient appears under "Send externally" in the input box. Note that Cmd+Enter (Ctrl+Enter on Windows) sends immediately without confirmation
- Only the person who connected the account can read the rooms
When it does not work
- The draft lands in a different thread:
subjectis filled in, orthread_idis invalid. Delete thesubjectrow, and checkthread_idin the input under "Recent runs" - The run fails, saying an inserted value is missing: it refers to a field that email does not have. Every field that arrives is treated as optional. Check email without a body and the like under "Recent runs"
- The step is refused: an admin has set this operation to "Confirm every time" or "Forbidden". Unattended runs cannot be approved, so ask for the setting to be changed
- You cannot find the draft: by default it runs with the connection of the person who created the trigger. Check whether it was created in a different account's Gmail
FAQ
Can AI send replies automatically?
This article is based on not sending. The "Send automatically" option in Channels' "AI reply" is only for chat rooms and cannot be used in email rooms.
Can it write with past exchanges or internal documents in mind?
"Generate with AI" has no tools, so it cannot look things up on its own. Write your reply policy in "Instructions", or pass set documents with "Files".
Can I do the same with Outlook?
The steps in this article are explained with Gmail's operation names. Outlook differs; for example, the body does not arrive at the start. See Post incoming Outlook mail to Teams.
Related how-tos
- Have AI read invoices in email and add them to a sheet
- Notify Slack of new Gmail
- Post incoming Outlook mail to Teams