Gmail trigger starting continously

I have a workflow that runs on a Gmail trigger. I receive about 30 emails with a specific subject and an attachment at 9 every morning, and the workflow has to save these attachments to a folder on Google drive. The search filter on the Gmail Trigger matches all of these mails that I have received.

I have tested the workflow and it works with a single email as expected.

After activation the workflow starts every minute with 10 items, even when I have received no new emails. It says that it has succeeded, but today it has used 900 of my 1000 trial Executions, and it still starts every minute with 10 items.

Is this connected to “NODE-320” (I assume this is a bug number?)

Information on your n8n setup

  • n8n version: 1.38.2
  • Database (default: SQLite): Default
  • n8n EXECUTIONS_PROCESS setting (default: own, main): Default
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Cloud
  • Operating system: Fedora Linux 40

Hi @Reinier_Mostert,

Happy you’re giving n8n a go! :fire:

So we are facing some issues with the Gmail Node fetching the same email multiple times. This is under investigation at the moment, but it seems to affect the node particularly when the inbox receives several emails close together.

As an alternative you can also use the IMAP trigger Node, that triggers the workflow once whenever an email is received.

Since this has cost you so many unexpected executions, feel free to send me a private message with your instance username and I will reset these for you :slight_smile:

Let me know how this works for you!

Hi,

thanks for the reply. I had a quick look at the IMAP trigger for accessing gmail, and that comes with a couple of issues:

  • Credentials are a problem. Google wants to enforce OAuth logins, and this is uername/password driven. There are workarounds with issues.

  • bigger concerns is that there is no message filtering, the trigger is called for every email I receive. I can filter in the workflow, but this will be an execution for every email I receive (and I receive around 200 per day).

  • Furthermore, there are different attachments that I want to process in different ways, and if I filter in the workflow, I will have to build one big workflow that can handle all the different attachments based on the subject or attachment name.

Handling gmail is my #1 priority for this tool, and the gmail Trigger that doesn’t work is a big stumbling block.

Regards

I’m sorry, I know this is not an ideal scenario, but at the moment we are still working on fixing the issues with the Gmail trigger Node.
I will add your post to the internal issue information to help track the high need for this fix.

Regarding the IMAP Node roadblocks you’re seeing:

  • You can follow along the credential set up documentation here to help guide you. Unfortunately Gmail is one of the fussiest ones.

  • You could create multiple inboxes in your gmail account and set certain sender’s emails to fall within one of those. Then, in the IMAP node, you can select to poll only that specific inbox.

Just a follow up question - I have tested this workflow, and it works with one item getting processed and saved to disk.

However, in production it sometimes runs with 10 items (or 38 items another time), and then it fails with the error “Cannot read properties of undefined (reading ‘toString’)”.

Is the 10 or 38 items part of the same problem with the gmail trigger?

Hi,

have now changed my google security settings to allow imap, and the credentials were tested successfully.

I followed the instructions you linked, and have created a new Mailbox. It is displaying below my Inbox with the correct emails in it. I have named this new Inbox, and entered the name in the “Email Trigger (IMAP)” node under parameter “Mailbox Name”.

Unfortunately, I get an error “Unknown Mailbox: FinOverview” when I test this step. Any idea on what the problem could be?

Thanks
Reinier

New version [email protected] got released which includes the GitHub PR 9424.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.