Gmail (OAuth)
Gmail (OAuth) node reference - all 45 operations, the credential it needs, and a worked example.
Gmail through a connected Google account. Send, search and read mail with bodies and attachments; manage threads, drafts, labels; and read or change auto-reply, filters and send-as settings.
Credential: Google account - see Credentials.
Scopes
Each operation below lists the scope it needs. Scopes are ticked as a scope preset when you connect the Google account, then consented to on Google's screen. If a run fails with a permission error, the node names the missing scope in the error - grant it and re-run; you do not need to rebuild the workflow.
Operations (45)
Send
| Operation | What it does | Scope |
|---|---|---|
send | Send email | Gmail (send) — gmail.send |
sendWithAttachment | Send email with attachments | Gmail (send) — gmail.send |
sendAs | Send email from an alias | Gmail (send) — gmail.send |
reply | Reply in thread | Gmail (send) — gmail.send |
forward | Forward a message | Gmail (send) — gmail.send |
Messages
| Operation | What it does | Scope |
|---|---|---|
list | Search messages | Gmail (read-only) — gmail.readonly |
getMessage | Get message (with body) | Gmail (read-only) — gmail.readonly |
trashMessage | Move message to trash | Gmail (modify) — gmail.modify |
untrashMessage | Restore message from trash | Gmail (modify) — gmail.modify |
archiveMessage | Archive message | Gmail (modify) — gmail.modify |
unarchiveMessage | Move message back to inbox | Gmail (modify) — gmail.modify |
modifyLabels | Add/remove label | Gmail (modify) — gmail.modify |
batchModifyLabels | Add/remove labels in bulk | Gmail (modify) — gmail.modify |
markReadStatus | Mark read/unread | Gmail (modify) — gmail.modify |
getAttachmentMetadata | List attachments | Gmail (read-only) — gmail.readonly |
getAttachment | Download attachment | Gmail (read-only) — gmail.readonly |
Threads
| Operation | What it does | Scope |
|---|---|---|
listThreads | Search threads | Gmail (read-only) — gmail.readonly |
getThread | Get thread | Gmail (read-only) — gmail.readonly |
modifyThreadLabels | Add/remove labels on a thread | Gmail (modify) — gmail.modify |
trashThread | Move thread to trash | Gmail (modify) — gmail.modify |
untrashThread | Restore thread from trash | Gmail (modify) — gmail.modify |
Drafts
| Operation | What it does | Scope |
|---|---|---|
createDraft | Create draft | Gmail (compose drafts) — gmail.compose |
listDrafts | List drafts | Gmail (compose drafts) — gmail.compose |
getDraft | Get draft | Gmail (compose drafts) — gmail.compose |
updateDraft | Update draft | Gmail (compose drafts) — gmail.compose |
sendDraft | Send draft | Gmail (send) — gmail.send |
deleteDraft | Delete draft | Gmail (compose drafts) — gmail.compose |
Labels
| Operation | What it does | Scope |
|---|---|---|
listLabels | List labels | Gmail (read-only) — gmail.readonly |
getLabel | Get label | Gmail (read-only) — gmail.readonly |
createLabel | Create label | Gmail (manage labels) — gmail.labels |
updateLabel | Update label | Gmail (manage labels) — gmail.labels |
deleteLabel | Delete label | Gmail (manage labels) — gmail.labels |
Account
| Operation | What it does | Scope |
|---|---|---|
getProfile | Get mailbox profile | Gmail (read-only) — gmail.readonly |
listHistory | List mailbox history | Gmail (read-only) — gmail.readonly |
Settings
| Operation | What it does | Scope |
|---|---|---|
getVacation | Get auto-reply settings | Gmail (settings) — gmail.settings.basic |
updateVacation | Set auto-reply (out of office) | Gmail (settings) — gmail.settings.basic |
listFilters | List filters | Gmail (settings) — gmail.settings.basic |
getFilter | Get filter | Gmail (settings) — gmail.settings.basic |
createFilter | Create filter | Gmail (settings) — gmail.settings.basic |
deleteFilter | Delete filter | Gmail (settings) — gmail.settings.basic |
listSendAsAliases | List send-as aliases | Gmail (settings) — gmail.settings.basic |
getSendAsAlias | Get send-as alias | Gmail (settings) — gmail.settings.basic |
updateSendAsAlias | Update alias signature | Gmail (settings) — gmail.settings.basic |
listForwardingAddresses | List forwarding addresses | Gmail (settings) — gmail.settings.basic |
getForwardingAddress | Get forwarding address | Gmail (settings) — gmail.settings.basic |
Example
Reply in-thread to the customer email that started the run
A support workflow classifies an inbound email and sends the drafted answer back on the same thread. The node re-reads the original message, so it fills in the recipient, the Re: subject and the In-Reply-To / References headers itself.
Set Operation to reply, then fill in:
| Field | Value | Notes |
|---|---|---|
messageId | {{trigger.messageId}} | The message being replied to - required; the recipient defaults to its From header |
body | Hi {{trigger.fromName}}, {{ai.answer}} | Reply body; Handlebars resolves against the run context |
bodyType | text | text or html - reply defaults to plain text |
Sets {{sent.messageId}}, {{sent.threadId}}, {{sent.to}} and {{sent.subject}}. Careful: messageId is the id of the message just SENT, not the one you replied to; threadId is the thread both now live on.