The Attachment node only works in a workflow started by a Mailhook trigger. It reads the triggering email from
{{ input }}, so the designer will refuse to save a workflow that has an Attachment node without a Mailhook trigger.When to use it
- “When an invoice arrives by email, pull the PDF and file it in the knowledge base.”
- “Forward every image attachment on to a colleague.”
- “Grab the one spreadsheet on the email and run it through a transform.”
Configuration
| Field | Description | Templated |
|---|---|---|
| Label | Display name on the canvas | No |
| Mode | Single returns the first matching attachment as an object; Multiple returns every match as a list | No |
| Content type | Filter by MIME type. Comma-separated, wildcards allowed, e.g. application/pdf, image/* | No |
| Filename pattern | Filter by filename glob, e.g. *.pdf or invoice-*.csv | No |
| Attachment ID | Select one exact attachment by id. When set, the other filters are ignored | Yes |
| Min / Max size | Filter by declared size in bytes | No |
| Fail if no attachment matches | Off by default: the step produces no output and the run continues. On: the step fails | No |
| Email ID (Advanced) | Defaults to the triggering email. Leave blank | Yes |
Filters
All filters are optional and combined with AND. Leave them all empty and choose Multiple to fetch every attachment on the email. The content-type filter accepts a comma-separated list and matches if any pattern matches, soapplication/pdf, image/png matches either, and image/* matches any image.
Output
In Single mode the output is one object:content is the file bytes, base64-encoded. In Multiple mode the output is a list:
count: 0, unless Fail if no attachment matches is on.
Using the bytes downstream
The output is shaped to drop straight into the nodes that consume files. With an output variable ofattachment:
- Send Email attachment: set filename to
{{ attachment.filename }}and content to{{ attachment.content }}. - Knowledge document input: set the input to
{{ attachment.content }}.
{{ attachment.attachments }} and reference each item’s content and filename. See Passing Data Between Nodes.
Limits
- Per attachment: each file is capped (10 MB by default). A larger file fails with a clear error. Base64 inflates the size roughly 1.33 times.
- Per run: the total downloaded across all Attachment nodes in one run is capped (25 MB by default). Exceeding it fails the run.
- Retention: received emails are retained for 30 days. Re-running an older execution can fail to download because the attachment link has expired.