I am using the Gmail Trigger node with the poll time set to every minute. We received two emails at 12:10am and the trigger was executed every minute for one of the two emails until 8:48am, when we disabled the workflow. This appears to be a bug?
I am very sorry you are having trouble. Based on the information provided I am unfortunately not able to reproduce the problem. Can you confirm which error exactly you’re seeing when opening your workflow execution?
The issue isn’t the workflow failure, but rather, the same email being triggered every minute for several hours. It occurred with a few emails and seems to be a known bug. We’ve addressed this problem by replacing the Gmail Trigger with IMAP Email Trigger.
This is happening with me as well. We haven’t updated the workflow, or updated N8N, it just randomly started today with one particular email.
I added a tag so it only picks up unread messages, and to untag it as “unread” once the message is processed, and now it’s picking up messages from months ago that are not “unread.” It appears that it’s not able to determine that a message is newly received anymore, and just returns the most recent message that matches whatever criteria you have set up.
Hi folks, I am really sorry for this but I am still unable to reproduce this based on the details provided in this thread.
I suspect it might be account or even message-specific. In general, n8n’s polling triggers can be really hard to debug. So perhaps you want to consider using the Schedule trigger and then poll your messages through the regular Gmail node? This will allow you to control exactly which messages are being retrieved.
Noticing the same issue here. As mentioned, this is very hard to reproduce.
I have noticed this across multiple Gmail accounts, can’t really identify any patterns here. It works as expected 99% of the time but will sometimes get tripped up on a random email and begin the aforementioned looping.
After trying what @jltxwesley suggested I have not noticed this behavior re-emerge.
One thing to note: It is hard to tell but I think the most common cause of email duplication is related to long-lived tasks with a short-lived polling period.
Our trigger is set to poll every minute and our run-to-run length varies wildly, some of our runs take 5+ minutes each, others take 5 seconds. I’ve noticed that it is only for the large runs that take a long time that I see this duplication.
Toggling the workflow off, waiting for a new email to come in after the email that is looping, then turning the workflow back on is the only way to fix it in the moment.
As I mentioned before, switching to IMAP fixes all of this, but just wanted to mention this.