DocumentationWorkflowsApps and services
Gmail node
Send, search, or read emails through your connected Gmail account. Google BYO credentials are stored as an encrypted OAuth profile in Workflow Secrets. Learn how to configure it, map inputs and outputs, run a test and resolve common errors.
9 min readUpdated
What this node does
Send, search, or read emails through your connected Gmail account. Google BYO credentials are stored as an encrypted OAuth profile in Workflow Secrets.
Use Gmail as a clearly defined step in an anymize workflow.
- Processes one input.
- Provides one output for following steps.
- Runs as a regular step in the flow.
Set up the node
- 01Open a workflow and add Gmail from the node catalog.
- 02Select your google_byo connection. You can create it directly in the workflow if needed.
- 03Complete the required fields and map values from previous steps.
- 04Run the node with a small test record and inspect its output.
- 05Connect the successful output and activate the workflow after an end-to-end test.
Operations and modes
Choose the required function in Action. The panel then shows the relevant settings.
- Send email
- Search messages
- Fetch message
- Add labels
- Remove labels
- Mark as read
- Mark as unread
Settings
| Field | Meaning | Area |
|---|---|---|
| Action | Choices: Send email, Search messages, Fetch message, Add labels, Remove labels, Mark as read, Mark as unread | Standard |
| Import format | Configure this value in the node panel. | Standard |
| Google account | Select your configured Google OAuth profile. Imported actions require this explicit account assignment. | Protected |
| Recipient | Who's the email going to? Separate multiple with a comma. | Standard |
| Subject | Configure this value in the node panel. | Standard |
| Message | Message content. Imported emails retain their explicitly selected text or HTML format. | Standard |
| Message format | Choices: Plain text, HTML | Standard |
| n8n notice from the template | Preserves the n8n notice at the end of a text message when the original template includes it. | Standard |
| Copy (CC) | Configure this value in the node panel. | Standard |
| Blind copy (BCC) | Configure this value in the node panel. | Standard |
| Reply address | Configure this value in the node panel. | Standard |
| Search | Filter like in the Gmail search bar, e.g. from:boss@firma.de, unread, has:attachment. Empty = all. | Standard |
| Max hits | Configure this value in the node panel. | Standard |
| Message ID | The ID of the email (e.g. from a previous "Search messages" step). | Standard |
| Labels | Enter Gmail label IDs as a list or use values from an earlier step. | Standard |
| Run once per item | Off (default): the node runs once for the whole input. On: if it receives several items (e.g. from Split Out), it runs once PER item, and {{ $json }} is that one item each time. This is how you work through a file list entry by entry. | Standard |
| If one item fails | "Skip" writes an `error` field for the failed item and keeps processing the rest, instead of losing the whole run to a single unreadable file. | Standard |
| Pause between items (milliseconds) | Wait before every run except the first. 1000 = 1 second per item. Useful when the other side would otherwise throttle you. Maximum 300000 (5 minutes). | Standard |
Inputs and outputs
| Input | Meaning | Type |
|---|---|---|
| Standard | Receives the complete result from the previous step. | JSON |
| Output | Meaning | Type |
|---|---|---|
| Standard | Makes the result available to the next step as JSON. | JSON |
This node can process lists item by item. Error handling and the delay between items are available in advanced settings.
Example and test run
Confirmation email: begin with a small, recognizable record. Inspect the output and only map fields that are present there.
Test-run example
{
"to": "kunde@example.com",
"subject": "Danke für deine Anfrage",
"body": "Wir melden uns in Kürze zurück."
}Access and security
This node uses a connected google_byo account. Review the requested permissions and grant only the required access.
Store keys and credentials in the protected connection manager. Never paste them into normal workflow fields, test data or descriptions.
Troubleshooting
- No output: inspect the latest run and confirm that the previous node returned the expected fields.
- Empty variable: open the previous step output and use a field name from the real test data.
- Connection rejected: reconnect the service and grant the permissions required by this step.
- List processed once: enable per-item execution in advanced settings.