Gmail:Get Attachments
Controlled node
Overview
Download Gmail attachments for use in your workflow.
Download file attachments from one Gmail message into the project library’s temporary-files directory. The returned file objects can be passed to the appropriate file-reading nodes.
Inputs
| Input | Type | Description |
|---|---|---|
| run | Event | Triggers this operation. |
| messageId | Text | Required message id from Get Inbox or Search Emails. |
Properties
| Setting | Type | Description |
|---|---|---|
| connections | Connection | Select an authenticated Gmail connection from this project in the properties panel. |
Outputs
| Output | Type | Description |
|---|---|---|
| attachments | Data | Array of downloaded library file objects with fields such as id, name, mimeType, size and dir. Failures can return error text; a missing connection can return an empty array. |
| done | Event | Fires when the node returns, including when it returns an error result. Check the data output before continuing. |
Working with the files
An empty array can mean no supported attachments were found. Individual files that fail to import may be omitted, so check the logs when you expect more files. Attachments nested inside other email parts may not be included.
Use a file reader that matches the attachment format. To keep files organised, move them from the temporary-files directory into a project library directory.
Example
Obtain a message’s id, select the same connection and trigger run. After checking attachments is an array, connect it to For Each → object and connect done to the loop’s run. For PDF attachments, connect element to Read PDF’s file input and loop to its run.