Save Gmail attachments in Google Drive
Check the documented steps for saving Gmail attachments to Drive, required permissions, duplicate handling and the limits of the available tests.
Content updated:
Does this route fit?
Search, message retrieval, attachment download and upload are documented for attachments you have selected. This route does not identify invoices on its own. Start with a narrowly scoped Gmail label and a dedicated destination folder.
Untested: no complete practical workflow established.
4/4 steps backed by API documentation.
Required apps
Setup and a small test
Define the Gmail query and inspect its results before writing. Walk all message parts: one message can contain several attachments.
Keep the attachment ID together with its message ID as provenance. Write the downloaded bytes to a dedicated Drive folder, then read them back.
Check the destination before retrying. A matching filename does not prove file identity; compare provenance and content.
Steps and evidence
Search messages
Gmail
Technically inspected · Workflow not yet practically tested
Details
Provider API:
gmail.users.messages.listGET gmail/v1/users/{userId}/messagesPermissions
Documented scope alternatives
https://mail.google.com/https://www.googleapis.com/auth/gmail.metadatahttps://www.googleapis.com/auth/gmail.modifyhttps://www.googleapis.com/auth/gmail.readonly
Do not request all scopes. Select the least privileged scope that covers the operation and resource.
Costs and limits
The provider describes standard use or use below its daily threshold without an additional API fee and announces future overage charges. Account, storage and connector costs may apply separately. Total cost has not been checked.
Source ·
Quotas apply per project and user. Check the limits assigned to your project; older Google projects may retain different quotas.
Source · Last confirmed:
Read a message
Gmail
Technically inspected · Workflow not yet practically tested
Details
Provider API:
gmail.users.messages.getGET gmail/v1/users/{userId}/messages/{id}Permissions
Documented scope alternatives
https://mail.google.com/https://www.googleapis.com/auth/gmail.addons.current.message.actionhttps://www.googleapis.com/auth/gmail.addons.current.message.metadatahttps://www.googleapis.com/auth/gmail.addons.current.message.readonlyhttps://www.googleapis.com/auth/gmail.metadatahttps://www.googleapis.com/auth/gmail.modifyhttps://www.googleapis.com/auth/gmail.readonly
Do not request all scopes. Select the least privileged scope that covers the operation and resource.
Costs and limits
The provider describes standard use or use below its daily threshold without an additional API fee and announces future overage charges. Account, storage and connector costs may apply separately. Total cost has not been checked.
Source ·
Quotas apply per project and user. Check the limits assigned to your project; older Google projects may retain different quotas.
Source · Last confirmed:
Download an attachment
Gmail
Technically inspected · Workflow not yet practically tested
Details
Provider API:
gmail.users.messages.attachments.getGET gmail/v1/users/{userId}/messages/{messageId}/attachments/{id}Permissions
Documented scope alternatives
https://mail.google.com/https://www.googleapis.com/auth/gmail.addons.current.message.actionhttps://www.googleapis.com/auth/gmail.addons.current.message.readonlyhttps://www.googleapis.com/auth/gmail.modifyhttps://www.googleapis.com/auth/gmail.readonly
Do not request all scopes. Select the least privileged scope that covers the operation and resource.
Data transfer between steps
- Decode the base64url data field before sending bytes to a file API.
Costs and limits
The provider describes standard use or use below its daily threshold without an additional API fee and announces future overage charges. Account, storage and connector costs may apply separately. Total cost has not been checked.
Source ·
Quotas apply per project and user. Check the limits assigned to your project; older Google projects may retain different quotas.
Source · Last confirmed:
Upload a file
Google Drive
Technically inspected · Workflow not yet practically tested
Details
Provider API:
drive.files.createPOST /upload/drive/v3/filesPermissions
Documented scope alternatives
https://www.googleapis.com/auth/drivehttps://www.googleapis.com/auth/drive.appdatahttps://www.googleapis.com/auth/drive.file
Do not request all scopes. Select the least privileged scope that covers the operation and resource.
Data transfer between steps
- Create a multipart request containing file metadata and the downloaded attachment bytes.
Costs and limits
The provider describes standard use or use below its daily threshold without an additional API fee and announces future overage charges. Account, storage and connector costs may apply separately. Total cost has not been checked.
Source ·
Quotas apply per project and user. Check the limits assigned to your project; older Google projects may retain different quotas.
Source · Last confirmed:
Tests and limitations
A PDF can be copied as a file. This proves neither text recognition nor invoice validation. Our local mail–file–table scenario uses synthetic XML; no complete provider test exists for this general attachment plan.
Public verification reports · Open the local runner and instructions
Alternatives
For occasional attachments, saving and checking them manually is a reasonable alternative. Collecting invoice amounts additionally requires classification and extraction.