Auto-save family photo emails to Google Photos albums

By General Input

Every two hours, grab photos that family and close friends emailed you and file them into the right Google Photos album by sender or event.

Integrations

  • Gmail
  • Google Photos

Type

Agentic Task

Categories

  • Personal Productivity
  • Operations

Build me an agent workflow that automatically archives photo attachments my family and close friends email me, sorted into a Google Photos album per sender (or per event when the subject names one).

Trigger: cron, every 2 hours.

Each run:

1. Use the Gmail List Messages operation with a query like `has:attachment newer_than:1d (from:mom@example.com OR from:dad@example.com OR label:family)` to find new image-bearing emails since the last run. Leave the sender list and label as workflow inputs the user can edit.

2. For each message, call Gmail Get a Message (format: full) to read headers (Subject, From, Date) and walk the payload parts to find image attachments (mimeType starts with image/, e.g. JPG, PNG, HEIC). For each image part, call Gmail Get Attachment to download the bytes (it returns base64url-encoded data; decode before uploading).

3. Reason about which album each set of photos belongs in. Default rule: one album per sender, named after the sender's display name (e.g. "Photos from Mom"). Override: if the subject line clearly names an event ("Hawaii 2026", "Emma's Birthday", "Wedding Weekend"), use that as the album title instead. Group attachments from the same thread together so a single trip lands in a single album.

4. Call Google Photos List Albums to find an existing album with that title. If none exists, call Create Album to make it. Remember: Google Photos only lets us see and edit albums this app created, so first-time users will start with fresh app-created albums.

5. Dedup before uploading: call Google Photos Search Media Items with an album filter on the target album, and skip any incoming attachment whose filename plus creationTime (the email's Date header) already exists in the album.

6. For each remaining image, call Google Photos Upload Bytes to get an upload token, then call Batch Create Media Items with the album id to attach the new items in one batch. Upload tokens expire after 24 hours, so do the batchCreate call promptly after uploading bytes (don't queue them up across runs).

7. For each newly created media item, call Update Media Item to set a short description derived from the email's subject line and sent date, e.g. "From Mom — \"Hawaii sunset\" — Mar 14, 2026".

Workflow inputs (so the user can edit without touching the prompt):

- senders: list of email addresses to watch

- label: optional Gmail label that also qualifies a message (e.g. "family")

- album_strategy: "per_sender" (default) or "single_album" with a single album name

- min_attachment_size_kb: optional, to ignore tiny tracking-pixel images

Be quiet on success. Only surface output when something needs the user's attention (e.g. an album hit its 20,000-item cap, or an attachment failed to upload). Do not re-process messages from previous runs; key off the email's internalDate and only handle messages newer than the last successful run timestamp.

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