n8n recipe · docs
Gmail → Google Drive
Attachments from new Gmail emails are saved to Google Drive, so files stop getting lost in your inbox.
지메일에 새 메일이 오면 첨부 파일을 구글 드라이브에 저장해요.
Steps
- When when a new email arrives in gmail — Gmail node
- Then save the attachment to google drive — Google Drive node
Fields to fill (3)
The file has every node wired up. These are the blanks only you can fill (your form, your sheet, your words).
| Node | What to do |
|---|---|
| Google Drive | note: takes the first attachment (attachment_0); for every attachment, add a Split Out step before this one |
| Google Drive | fill driveId (The drive where to upload the file) |
| Google Drive | fill folderId (The folder where to upload the file) |
Accounts to connect (2)
In n8n, pick or add a credential on each node — one of the types below.
- Gmail:
googleApiorgmailOAuth2 - Google Drive:
googleApiorgoogleDriveOAuth2Api
Get the n8n file
Download gmail-attachments-to-google-drive.json
- Open a new, empty workflow in n8n.
- Open the workflow menu (⋯) and choose Import from File — or copy the JSON below and paste it onto the canvas (Ctrl/Cmd+V).
- Connect the accounts, fill the fields above, run one test, then turn the workflow on.
Or copy the JSON
{
"name": "Attachments from new Gmail emails are saved to Google Drive",
"nodes": [
{
"id": "n1",
"name": "Gmail Trigger",
"type": "n8n-nodes-base.gmailTrigger",
"typeVersion": 1.4,
"parameters": {
"event": "messageReceived",
"simple": false,
"options": {
"downloadAttachments": true
},
"filters": {
"q": "has:attachment"
}
},
"position": [
240,
300
],
"notes": "step: when a new email arrives in gmail"
},
{
"id": "n2",
"name": "Google Drive",
"type": "n8n-nodes-base.googleDrive",
"typeVersion": 3,
"parameters": {
"resource": "file",
"operation": "upload",
"inputDataFieldName": "attachment_0",
"driveId": {
"__rl": true,
"mode": "list",
"value": ""
},
"folderId": {
"__rl": true,
"mode": "list",
"value": ""
}
},
"position": [
460,
300
],
"notes": "step: save the attachment to google drive"
}
],
"connections": {
"Gmail Trigger": {
"main": [
[
{
"node": "Google Drive",
"type": "main",
"index": 0
}
]
]
}
},
"settings": {
"executionOrder": "v1"
},
"active": false
}