Email attachments filed to Drive automatically with Gemini

The struggle: Invoices, forms and reports arrive by email, and someone has to save each attachment to the right folder by hand.

What you end up with: A Workspace Studio flow that saves attachments from chosen emails into a Drive folder, tested on a copy first.

A Workspace Studio flow can run when an email with an attachment arrives and add that attachment to Drive. You test it on a copy folder before you point it at the real one.

Tools: Gemini. Level: Team. Time: 45 min.

Use it if

  • The same kind of attachment arrives every week
  • You have a Workspace business or education plan
  • One folder is enough for the files

Skip it if

  • The attachments contain sensitive personal data; ask your admin first
  • You use a personal Google account

What you need first

  • A Google Workspace Business, Enterprise or Education plan with Workspace Studio switched on by your admin
  • A test folder in Drive

The method

  1. Make a test folder (Gemini: Drive)

    In Drive create a folder called [test folder name] and share it only with yourself. This is where the flow saves files while you test.

    Prompt to copy:

    I receive [type of attachment] by email from [senders]. Suggest a folder structure in Drive and a naming rule for the saved files, with the date first. Keep it to 3 levels at most.

    You get: A safe folder to test in.

    Tip: Use a copy of your real structure.

  2. Choose the starter and condition (Gemini: Workspace Studio)

    Create a flow with the starter When I get an email, and turn on the starter filter Has attachment. Narrow it by sender or subject, for example with Check if, so it only catches the files you mean.

    Prompt to copy:

    Suggest a narrow condition for a Gmail flow that catches only emails from [sender or domain] with a subject containing [words] and an attachment. List what it would wrongly catch, so I can test those.

    You get: A flow that triggers for the right emails.

    Tip: Make the condition narrow. A broad one files junk.

  3. Add the Drive step (Gemini: Workspace Studio)

    Add the Drive step Add email attachments to Drive and pick the test folder. Run the flow with a real test email.

    You get: Attachments appearing in the test folder.

    Tip: Check file names after the first runs.

  4. Add a note for you (Gemini: Workspace Studio)

    Add Notify me by email (a Gmail step) or Notify me in Chat (a Chat step) that says which file was filed and from whom.

    Prompt to copy:

    Write a short notice: filed [file name] from [sender] on [date] into [folder]. If a value is missing write NOT GIVEN.

    You get: A short note each time a file is saved.

    Tip: You read the note, so mistakes show up the same day.

  5. Switch to the real folder (Gemini: Workspace Studio)

    After a week of correct results, change the folder to the real one. Keep the notice step so you still see what moves.

    You get: A flow filing into the real folder.

    Tip: Review the folder weekly.

Where this goes wrong

  • Admins may require approval for steps that share data outside the organisation.
  • The flow reads only your own mailbox. Check that file names do not collide, and that each folder's sharing settings suit the files in it, since a sensitive file in a wrong or shared folder can be seen by others.
  • Do not add steps that send, reply or delete without a person checking. The flow stops at saving and a notice to you.

Sources

More like this

Updated . Written with AI help and checked by an independent review step, as described in our editorial standards.