What this Flow will do is:

  • Check all the inbound emails in your inbox;

  • If there is at least one attachment, it will save all the attachments from the email in the chosen Google Drive folder.


Watch a 3-min video:

Or follow the steps:

Step 1: Create a new Flow.

Step 2: Choose a Trigger

Our Flow will start from the Email Arrival.

Step 3: Name a Flow

It’s important to name your Flow, so you can easily find it in the future when needed.

Step 4: Configure the Trigger

Click on the Trigger icon in your Flow Designer and perform one simple action: authorize zenphi to access your Gmail account.

Once your Trigger is configured, you’ll see the Run icon on it.

Step 5: Enable If condition Action

We want to run our Flow only when the email has at least one attachment, so we need to stick the “If condition” to the logic of our process.

✏️ Note: The If Condition is the most common way to create a branching logic in Flows. The If Condition is useful for scenarios where you would want to go to one of the two paths in the Flow-based on certain condition(s).

You can rename the Action right away, so it’s easier to understand what’s going on in this process if you need to make some changes, for example.

Now let’s click on the gear icon in the If Condition action and set it up.

For this scenario, we should set our conditions as follows: When Attachments Count greater than 0

There are two ways to fill in the data to the conditions fields:

  • Insert tokens (the data from the previous Triggers or Actions

  • Just by typing it in (like we did with the "0")

💡 Pro tip: you can add more conditions with and/or logic for more complex scenarios.

Step 6: Enabling Foreach Item Action

Super! Time to configure the second Action.

Find Foreach Item Action in the Control Flow section and stick it to the True branch. The Foreach Item will help us save not only one attachment from the Email but all of them.

💡 Pro tip: to quickly find needed Actions, just use the search toolbar in the top footer 🔎

Quickly rename this Action as well:

And open the Settings:

In the Collection field, we need to choose what exact Item will be saved in the Google Drive - select Attachment.

Step 7: Enabling the Save File Action

Scroll down to the Google Drive section and stick the Save File action.

Here, we'll start with the same Google account connection for your Google Drive. Zenphi will ask you for your permission for most kinds of Triggers/Actions.

Then, we should fill in:

  • File Payloads - that’s the actual file that will be saved. The smart suggestion will show you the best option, File Content.

  • Destination folder - choose where you want to save your file.

The Flow is ready to go 👏 It's simple as that!

Step 8: Save the Flow

It’s important to Save all the changes you make in the Flow. Each Saved change creates a new version of your Flow - you see the number of the version right near the Save button.

Step 9: Run a Test

Test Run is a perfect way to see your Flow in action.

Let’s choose a “Select an email to start”:

Make sure that you have at least one email with the attachment for the test. If not, send yourself one, return to zenphi, and choose this email from the list displayed.

The emails with the attachments will be highlighted. Choose an email and click on Start.

From the left sidebar, you’ll see how your Flow runs live.

Wait for the ✅ Completed status, and then open the Google Drive Folder and see the Saved Files there.

The test is successful! Good job 💪 You can close the Test mode.

Step 10: Publish a Flow

The Flow is ready to be Published now.

From now on, every attachment from the incoming email will be saved to Google Drive.

Let’s sum up what we’ve done

  1. Created a Flow that starts from the Email Arrival trigger.

  2. Named the Flow.

  3. Authorized zenphi to access Gmail account.

  4. Added and configured the If Condition Action.

  5. Added and configured the Foreach Item Action.

  6. Added and configured the Save File Action.

  7. Authorized zenphi to access Google Drive.

  8. Renamed the Actions.

  9. Saved the Flow.

  10. Ran a Test Flow.

  11. Published the Flow.

💡 Bonus tip

If Condition is not the only way to run a conditional logic. If we go back to the Trigger (Email Arrival) and switch to Conditional Run, we can build the same Flow but with fewer Actions.

The Conditional Run feature is available from the Pro Tier and above.

What’s next?

In the Recent runs tab, you’ll see all the executions of Flows and their Statuses.

In the Flows tab, you can see the analytics for each Flow and open back a Flow Designer to make changes to your Flow.

Congrats on achieving another win!


Learn more

🎓 See how to store and interact with the data from your Flows with Zenphi Tables here

🎓 Learn how to create a Dashboard with the results from your Flows with Zenphi Apps here

Follow us on Social Media to receive our latest process automation tips and best practices:


Did this answer your question?