Auto-file Gmail attachments into Dropbox folders

By General Input

Drop new email attachments into the right Dropbox folder automatically, every 15 minutes, with smart routing rules you control.

Integrations

  • Gmail
  • Dropbox

Type

Agentic Task

Categories

  • Operations
  • Personal Productivity

Build an agent workflow that drains Gmail attachments into the correct Dropbox folder so I never have to drag files around again.

Trigger: cron, every 15 minutes.

On each run, the agent should:

1) Use Gmail List Messages with a query of has:attachment newer_than:1h and a label filter of Unfiled to find new candidate messages.

2) For each message returned, use Gmail Get a Message (format=full) to read the subject, sender, body snippet, and attachment metadata.

3) For each attachment on that message, use Gmail Get Attachment to pull the file content.

4) Decide the right Dropbox destination folder using the routing rules below combined with the agent's own judgement about the email content. Examples I want to start with:

- Email from a known attorney domain with a PDF attached goes to /Contracts.

- Email from a vendor with a PDF that looks like an invoice (mentions invoice number, amount due, bill to) goes to /Finance/Invoices/Incoming.

- Image attachments (PNG, JPG, screenshots) from designer contacts go to /Design/Inbound.

- Anything the agent is not at least reasonably confident about goes to /Inbox/To Sort instead, and the email keeps a Needs Review label rather than getting marked Filed.

5) Use Dropbox Upload File to upload the attachment at the chosen path. Rename the file to {YYYY-MM-DD}-{sender-domain-or-name}-{original-filename}, replacing spaces with hyphens and stripping characters Dropbox does not allow. If a file with the same name already exists, append a short counter rather than overwriting.

6) On successful upload, use Gmail Modify Message Labels to remove the Unfiled label and add a Filed label.

7) If filing fails for any reason (upload error, no confident folder pick, missing label), do not remove the Unfiled label. For low-confidence picks, also add a Needs Review label so I can spot them in Gmail.

Keep a short run summary at the end of each execution: how many messages were checked, how many attachments were filed, the path each one went to, and any messages that ended up in Needs Review with a one-line reason. I want this to be safe to leave running unattended, so it must never overwrite an existing Dropbox file and must never delete or trash a Gmail message.

Related prompts

Explore more prompts
Win back LiveChat visitors whose chats went unansweredChase the paperwork every new client and vendor still owesFile Gmail attachments into storage with names you can findCandidate rediscovery desk for your archived Lever applicantsLaytime and demurrage claim workspace for chartering opsKajabi customer support console for member access fixesRun your application review round on Jotform submissionsRun your nutrition clients' weekly meal plans from one consoleReplace the dispatch whiteboard with a live production boardJob search command center with a self-filling pipeline board