Title: How to scan past Gmail emails for invoice attachments?

alaa bebar

Member
Consent to Access & Modify
I authorize Pabbly Support to log in to my account and make changes to the specified workflow for troubleshooting.
Hi Arshil,


I’m using Pabbly Connect and want to scan existing Gmail emails (not only new ones) to find invoice / bill attachments.


What I’m trying to do:


  • Scan old Gmail emails
  • Find emails with PDF attachments
  • Identify invoices or bills automatically
  • Process those attachments in bulk

My questions:


  • Is there a simple way to scan past emails in Gmail using Pabbly?
  • Can Gmail search filters like has:attachment or filename:pdf be used?
  • Any tips to avoid API limits when scanning a large number of emails?

@ArshilAhmad
Please refer to a workflow you helped me with in the past.
Instead of filtering by sender or subject, I want the workflow to automatically identify whether an attachment is a bill or an invoice, with minimum task usage.


I’ll attach a URL to the existing workflow I previously built for this automation.
Main URL: https://connect.pabbly.com/workflow/mapping/IjU3NjUwNTZlMDYzZTA0MzU1MjY4NTUzMjUxM2Ei_pc
Invoices: https://connect.pabbly.com/workflow/mapping/IjU3NjUwNTZiMDYzZjA0M2Q1MjY4NTUzNDUxM2Ii_pc
bills: https://connect.pabbly.com/workflow/mapping/IjU3NjUwNTZhMDYzMzA0MzY1MjY5NTUzNDUxM2Ii_pc


Thanks in advance for the help 🙏
 

Preeti Paryani

Well-known member
Staff member
Hello @alaa bebar,

Thank you for sharing the detailed use case and workflow URLs.

At the moment, this use case is not fully possible with Pabbly Connect. The Gmail – Find Email action is designed to return only a single email per query, even when search operators such as has:attachment or filename:pdf are used. Because of this limitation, scanning and processing multiple past emails in bulk is not currently supported.

To enable this use case, a new capability such as “Find/List Emails (multiple)” would be required. We recommend submitting this as a feature request on our roadmap using the link below. Once you’ve added the request, please share the roadmap link with us so we can track and upvote it internally:
https://roadmap.pabbly.com/b/Update-Existing-Application

Additionally, please note:
  • Gmail does not return attachment URLs directly in its API responses.
  • The response provides messageId and attachmentId only.
  • To fetch the actual file, a separate action (Get Attachment by ID) is required using those IDs.

Once a multi-email fetch action is introduced, your workflow will be feasible using this flow with controlled task usage.
 
Top