Skip to main content

Save all attachments

Save the attachments of every Gmail message that matches a search or the filters, optionally marking them as read.

Command in the Google Workspace toolkit · id ooa.google/gmail_save_all_attachments · 14 inputs (2 required), 2 outputs

Inputs​

InputTypeRequiredDefaultWhat it is
Access tokenCredentialYesGoogle OAuth access token from the vault; or leave it empty and choose a connection that signs in, which gets and renews the token.
Target folderFileYesFolder to save into.
Name patternStringNo*Only names matching this pattern, e.g. *.pdf.
QueryStringNoGmail search selecting the messages; all messages with attachments when empty.
From containsStringNoSender contains this text; separate several with ; to match any of them.
Subject containsStringNoSubject contains these words; separate several with ; to match any of them.
SinceDateTimeNoReceived on or after this time (UTC).
BeforeDateTimeNoReceived before this time (UTC).
StatusStringNoanyOnly unread or only read messages.
LabelStringNoOnly messages with this label, e.g. INBOX or Invoices; several separated by ; (G5).
OverwriteBooleanNofalseReplace files of the same name instead of adding a number such as (2).
Mark readBooleanNofalseMark each matching message as read afterwards.
Maximum messagesNumberNo100Upper limit of messages handled in one run; 0 for no limit (G5).
Endpoint addressStringNoReplaces https://*.googleapis.com for testing or a proxy; leave empty normally.

Outputs​

OutputTypeWhat it is
filesListSaved file paths.
message_countNumberNumber of messages that matched.