This workflow follows the Gmail Trigger → HTTP Request recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"name": "IMPORTANT",
"nodes": [
{
"parameters": {
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
},
"simple": false,
"filters": {
"q": "has:attachment"
},
"options": {
"downloadAttachments": true
}
},
"id": "7fa712ce-d2fe-4ddd-8de8-1c02b6cc3054",
"name": "Trigger - New Email",
"type": "n8n-nodes-base.gmailTrigger",
"position": [
0,
0
],
"notesInFlow": true,
"typeVersion": 1.1,
"credentials": {
"gmailOAuth2": {
"name": "<your credential>"
}
},
"notes": "has:attachment"
},
{
"parameters": {
"functionCode": "const out = [];\n\nfor (const item of items) {\n const binaries = item.binary || {};\n const from = item.json?.from?.value?.[0]?.address || '';\n const subject = item.json?.subject || '';\n const messageId = item.json?.messageId || item.json?.id || '';\n const receivedAt = item.json?.date || item.json?.internalDate || '';\n\n for (const [key, bin] of Object.entries(binaries)) {\n if (!bin) continue;\n out.push({\n json: {\n from,\n subject,\n messageId,\n receivedAt,\n originalFileName: bin.fileName || key\n },\n binary: {\n file: bin // expose the attachment under 'file'\n }\n });\n }\n}\n\nreturn out;"
},
"id": "4b821012-dd9e-4c50-bf22-58a1f0d5e6bc",
"name": "Flatten Attachments",
"type": "n8n-nodes-base.function",
"position": [
224,
0
],
"typeVersion": 1
},
{
"parameters": {
"method": "POST",
"url": "https://megasporic-bewailingly-dominik.ngrok-free.dev/api/upload",
"sendBody": true,
"contentType": "multipart-form-data",
"bodyParameters": {
"parameters": [
{
"parameterType": "formBinaryData",
"name": "file",
"inputDataFieldName": "file"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
432,
0
],
"id": "75f077c1-1259-4b1d-a01f-f19d69d01559",
"name": "HTTP Request"
}
],
"connections": {
"Trigger - New Email": {
"main": [
[
{
"node": "Flatten Attachments",
"type": "main",
"index": 0
}
]
]
},
"Flatten Attachments": {
"main": [
[
{
"node": "HTTP Request",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "1326971e-23b1-49d4-812f-e2a28bb29fc6",
"meta": {
"templateCredsSetupCompleted": true
},
"id": "2fdlTozxychtfzln",
"tags": []
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
gmailOAuth2
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
IMPORTANT. Uses gmailTrigger, httpRequest. Event-driven trigger; 3 nodes.
Source: https://github.com/EraChanZZZ/BigBerlinHack/blob/7272a251d38d6d9ce163132772f0f3808912db84/n8n/upload.json — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
This workflow ingests proof-of-delivery and completion documents from Gmail or a webhook, extracts key fields with an OpenRouter vision model, reconciles them against Google Sheets dispatch data, arch
Limit. Uses gmailTrigger, httpRequest, limit, respondToWebhook. Event-driven trigger; 40 nodes.
This workflow is ideal for IT professionals, security analysts, and organizations looking to enhance their email security practices. It is particularly useful for those who need to analyze Gmail email
Gmailtrigger Workflow. Uses gmailTrigger, httpRequest. Event-driven trigger; 40 nodes.
AICARE Email Blast System. Uses googleDrive, httpRequest, googleSheets, gmail. Event-driven trigger; 39 nodes.