logo
Documents
Mar 14

How to merge PDFs from Gmail and save to Google Drive using Zapier

Internet Marketer

In this article, we continue exploring Zapier's capabilities, and this time, we'll focus on merging PDFs using Zapier and Plumsail Documents. Previously, we covered how to split PDFs automatically. Now, let's explore the opposite scenario: merging multiple PDF files into one. This use case is common in businesses that process invoices, contracts, reports, or any multi-part documents arriving via email.

This automation idea comes straight from the Zapier Community, where users often ask about combining PDFs received in Gmail or cloud storage.

How to merge two PDF files from Gmail and Upload to Google Drive?
Zapier Community
Is it possible to merge all files in a Google Drive folder using Zapier?
Zapier Community

Whether you need to merge PDFs from emails, cloud storage, or CRM systems, this workflow can save you hours of manual work. Let's dive in and set up the automation!

In this article:

  1. Overview of the automation workflow
  2. Step 1: Configure the Gmail Trigger
  3. Step 2: Filter incoming emails
  4. Step 3: Use Plumsail Documents to merge the PDF
  5. Step 4: Upload merged PDF files back to Google Drive
  6. Get started with Plumsail Documents and merge PDF in Zapier

 

Overview of the automation workflow

Before diving into the setup, let's break down what this automation will do in simple terms. The workflow follows these key steps:

  1. Detect new emails – Zapier monitors Gmail for incoming messages with PDF attachments.
  2. Filter relevant emails – Only emails containing at least two PDFs are processed.
  3. Merge PDFs – Plumsail Documents combines the attachments into a single PDF.
  4. Save to Google Drive – The final document is uploaded to a designated folder.

Here's how the workflow looks visually:

Merge PDFs from Gmail to Google Drive using Zapier and Plumsail Documents  

Now, let's configure each step.

Step 1: Set Up the Gmail Trigger in Zapier

To start, we need to configure Zapier to monitor incoming emails in Gmail. This step ensures that any email containing PDF attachments is automatically processed.

  • Log in to your Zapier account and create a new Zap.
  • Choose Gmail as the trigger app.
  • Select New Email as the trigger event. This will monitor incoming emails for attachments.

Set up a Gmail trigger in Zapier to detect new emails with PDF attachments  

  • Connect your Gmail account and choose the INBOX as the label/mailbox to monitor.

Configure Gmail to monitor the inbox for incoming emails  

  • Click Continue and test the trigger to ensure Zapier detects new emails.

In this flow, Zapier checks for new emails every two minutes, ensuring that PDFs are merged quickly without long waiting times. However, if you need more control over when the process runs, you can use Schedule by Zapier instead. This allows you to trigger the workflow at fixed intervals (e.g., every 15 minutes, hourly, or daily), which can help optimize task usage for high-volume inboxes.

Step 2: Filter incoming emails

To ensure that only relevant emails are processed, it's important to apply filters that exclude unnecessary messages. This step prevents the workflow from triggering for emails that don't meet the required conditions, such as those without PDF attachments or those that don't match specific sender or subject criteria.

  • Add Filter by Zapier as the next action.

Add Filter by Zapier action  

  • Set up a condition to process only emails that contain at least two PDF attachments.
  • In the Only continue if section, choose Attachment Count from Gmail action.
  • Set the condition to (Number) Greater than 1. This ensures that only emails with at least two PDF attachments are processed, preventing unnecessary actions on emails with a single or no attachment, as the merging step requires multiple PDF files.
  • (Optional) Add additional conditions, such as filtering by subject line, sender, attachment type, presence of PDF files, and other criteria.

Set up a filter in Zapier to process only relevant emails  

  • Click Continue and test the filter to ensure only the correct emails are processed.

Step 3: Merge PDFs with Plumsail Documents

Once the filter is set up, the next step is to merge PDFs using Plumsail Documents in Zapier. This action will combine multiple PDFs into a single document for easier management.

If you don't have a Plumsail Documents account, start a free one-month trial to test this and other automations.

  • Add Plumsail Documents as the next action.
  • Choose Merge PDF as the action event.

Select the "Merge PDF" action in Plumsail Documents within Zapier  

  • Connect your Plumsail Documents account.
  • In the Files field, map the extracted PDF attachments from Gmail. If you don't see the data immediately, try entering it manually in the search bar to locate the correct field.

Map extracted PDF attachments to the "Merge PDF" action in Plumsail Documents  

  • Click Continue and test to verify that the PDFs are merged successfully.

Step 4: Upload Merged PDF to Google Drive

Now that the PDFs are successfully merged, the final step is to store the combined document in Google Drive. This ensures that the processed file is automatically saved in a structured location, making it easy to access, share, or use in further workflows.

  • Add Google Drive as the next action.
  • Choose Upload File as the action event.
  • Connect your Google Drive account.

Add Google Drive as the next action in Zapier to upload the merged PDF  

  • In the File field, select the merged PDF output from the previous step.
  • In the File Name field, use a dynamic value from the trigger. For example, you can take the sender's name and append the word "contract", so the final document name will be SenderName_contract.pdf. You can also use other dynamic values, such as the email subject or the date the email was received.
  • Leave the field File Extension empty. The PDF extension applies automatically.
  • Keep other fields unchanged.

Set up file upload settings for Google Drive in Zapier  

  • Click Continue and test to confirm that the file is saved in Google Drive.

Get started with Plumsail Documents and merge PDF in Zapier

Now you have a fully automated process for merging PDFs in Zapier using Plumsail Documents.
This setup ensures that whenever you receive PDF attachments in Gmail, they are merged and stored in Google Drive without any manual work.

Here's how it looks when the flow runs successfully:

Store the final merged PDF in Google Drive after processing through Zapier  

You can easily adapt this workflow to work with any other data source, including cloud storage services like OneDrive, Dropbox, or SharePoint, email providers such as Outlook, Yahoo Mail, or any IMAP-supported service, as well as databases and CRM systems.

Give it a try and see how much time you can save! Start your free trial of Plumsail Documents and set up your first automated workflow today!