Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (n8n-nodes-gmail-custom) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
n8n-nodes-gmail-custom
Self-contained n8n node for sending emails via Gmail API with a Google service account and domain-wide delegation.
No credential setup in n8n required — all parameters are inline, supports expressions.
Features
- Self-contained: service account email + private key are node parameters (no n8n credential needed)
- Token caching: access token reused for 58 minutes — only 1 oauth call per hour instead of per email
- Domain-wide delegation: send as any user in your Workspace domain
- Sender name: set a display name without extra API calls
- Optional custom Message-ID: auto-generated
<uuid@domain>or specify your own — included in output - Attachments: from binary data with graceful skip if missing
- HTML and plain text email support
Installation
In n8n: Settings → Community Nodes → Install → n8n-nodes-gmail-custom
Usage
- Add a Gmail Custom node to your workflow
- Fill in the required fields (supports expressions):
| Field | Description | Example |
|---|---|---|
| Service Account Email | Your SA client_email |
sa-name@project.iam.gserviceaccount.com |
| Private Key | RSA private key (PEM, hidden) | Expression from a previous node |
| From Email | The user to impersonate (DWD) | sender@your-domain.com |
| To | Recipient(s), comma-separated | recipient@example.com |
| Subject | Email subject | Hello World |
| Email Type | HTML or Text |
HTML |
| Message | Email body | Your HTML or text |
- Configure Options as needed:
- CC / BCC: carbon copy recipients
- Reply To: reply-to address
- Sender Name: display name (e.g.
John Doe) - Attachments: binary data field names from previous nodes
- Custom Message-ID: enable and optionally specify a
Message-IDheader. Auto-generated as<uuid@domain>if left empty. Returned in the node output.
Output
{
"id": "19ef486e4ed521e6",
"threadId": "19ef486e4ed521e6",
"labelIds": ["SENT"],
"messageId": "<generated-uuid@your-domain.com>"
}messageId is only present when the Custom Message-ID option is enabled.
How it works
- Signs a JWT with the service account private key
- Obtains an access token from
oauth2.googleapis.com/token(cached) - Builds a MIME email message
- Sends via
POST gmail.googleapis.com/gmail/v1/users/me/messages/send
Per email sent: 1 Gmail API call (token is cached for 1 hour).
License
MIT