Get Attachment
gmail.get_attachment
ActionEmailconnection required
Calls messages.get for the part list, then messages.attachments.get.
Download one attachment from a Gmail message as a base64 file blob.
Connection
- Required
- Yes — the node will not save without one
- Auth type
- OAuth 2.0
- Providers
- Gmail
- Secret shape
- {"client_id", "client_secret", "refresh_token"}
- Resolved by
- config.connection_id, else node.connection_id
Configuration
4 fields, 1 required. A dotted path is a nested object and name[] an array of objects — the editor renders the same tree.
| Field | Type | Required | Default | Constraints | Example |
|---|---|---|---|---|---|
message_id Gmail message id. Supports {{ }}. | string | Yes | — | — | — |
attachment_id Attachment id from the message's attachments[]. Gmail mints a NEW id on every messages.get, so an id only identifies the bytes, never which part they came from — prefer filename or part_id when the name and MIME type matter. Leave empty to pick by filename, or to take the first attachment. | string | No | — | — | — |
filename Download the attachment with this name instead of an id. | string | No | — | — | — |
part_id MIME part id from the message's attachments[]. Unlike attachment_id this is stable across fetches, so it is the durable way to name one of several attachments. | string | No | — | — | — |
Output
One shape.
file
| Field | Type | Example |
|---|---|---|
ok | boolean | — |
message_id | string | — |
attachment_id | string | — |
part_id The MIME part the bytes came from. | string | — |
file_content The file, base64-encoded. | string | — |
content_encoding | string | base64 |
filename | string | app-main.zip |
content_type | string | application/zip |
size Raw size in bytes (before base64). | number | — |
{
"attachment_id": "",
"content_encoding": "base64",
"content_type": "application/zip",
"file_content": "",
"filename": "app-main.zip",
"message_id": "",
"ok": false,
"part_id": "",
"size": 0
}Templates that use Gmail
Solutions with Gmail
See Get Attachment run in a workflow.
In a technical demo we add the Gmail connection, drop the node on the canvas and let Workflow Health pre-flight it before the first real run.