Skip to main content

Send Gmail messages with custom aliases and attachments via API

Workflow preview

Workflow preview
100%
Send Gmail messages with custom aliases and attachments via API preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

This n8n template allows you to send emails with a custom alias from your Gmail account Since the native Gmail node has some limitations regarding use of email aliases, this template allows you to ...

Best for

  • Personal Productivity automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.httprequest, n8n-nodes-base.code, n8n-nodes-base.splitout, n8n-nodes-base.if, n8n-nodes-base.webhook

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Jacob @ vwork Digital.

Original n8n.io source

1.1 Workflow description

Title
Send Gmail messages with custom aliases and attachments via API
Workflow name
Send Gmail messages with custom aliases and attachments via API

This n8n template allows you to send emails with a custom alias from your Gmail account

Since the native Gmail node has some limitations regarding use of email aliases, this template allows you to set up your own internal endpoint/sub-workflow to send emails as an email alias .

How it works

This workflow uses a Code node and the Gmail API via an HTTP node to format the email content and send using an alias on your Gmail account.

Setup instructions

  1. You must have added the email address as an alias you wish to send as in your Gmail account, guide on how to do so here.
  2. You must have created a Gmail credential in N8N, guide on how to do so here.
  3. Use your Gmail OAuth Credential in the HTTP node.
  4. Use this template as an API endpoint or a sub-workflow, and send this payload to it via POST:
{
  "senderName": "SENDER NAME HERE",
  "fromEmail": "FROM EMAIL HERE",
  "replyTo": "REPLY TO EMAIL HERE",
  "toEmail": "[email protected]",
  "subject": "SUBJECT LINE HERE",
  "htmlBody": "HTML BODY HERE - MUST BE JSON STRINGIFIED",
  "file_urls": [
    "FILE URLS FOR ATTACHMENTS HERE"
  ]
}

Notes

Only the following are required fields:

  • fromEmail
  • toEmail
  • subject
  • htmlBody

Customizing this workflow

You can easily convert this to a sub-workflow by swapping out the Webhook trigger for a "When executed by another workflow" trigger

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Send Gmail as Alias

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 2 - Format Email Payload

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 3 - Split Out Attachments

Type / Role
n8n-nodes-base.splitOut - splitOut
Config choices
Version 1

Block 4 - If Attachments

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 5 - Download Attachments

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 6 - Webhook Trigger

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2

3. Summary Table

Workflow Send Gmail messages with custom aliases and attachments via API
Complexity intermediate
Nodes 6
Categories Personal Productivity
Author Jacob @ vwork Digital
Published 02 Jul 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/5613/5613.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Send Gmail messages with custom aliases and attachments via API do?

This n8n template allows you to send emails with a custom alias from your Gmail account Since the native Gmail node has some limitations regarding use of email aliases, this template allows you to ...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Personal Productivity use case.