A polling-based pseudo-trigger for Gmail

It would help if there was a node for: polling Gmail

My use case:

Poll Gmail every few minutes for new emails (potentially matching a gmail query as in the regular Gmail node), so that an action can be taken on them.

Any resources to support this?

  • There is a post on the blog that addresses polling in general, but it has to be inserted/adapted into each workflow.
  • There is also an Imap node that can retrieve email on the fly, but:
    • it can’t implement Gmail queries
    • it implies setup overhead for people who have set up Gmail credentials and don’t want to activate Imap.
  • My proposal would be a “pseudo-trigger” node for gmail, that implements the message-retrieval logic from the main node, with similar parameters, and an extra “polling interval” parameter. The gmail query would be modified (or created) to include an “after” parameter to retrieve only emails from around the last poll (plus some margin). The logic to remember emails already seen would be inspired from the blog post.

Are you willing to work on this?

Potentially. I’m not a developer but I was thinking this might be an interesting exercise to try and build it – it should be mostly copy/paste and some tinkering – if it’s confirmed to be a valid idea.

I like this idea very much @Pierric, thanks for sharing! Also, don’t forget to vote on it yourself (if you still have votes left, of course).

Similar requests have come up before for a bunch of services, so you might also want to consider leaving your vote on related feature requests, for example this more generic approach from @bartv:

Or this one from @Binks:

1 Like

Thanks @MutedJam !

I did try to search for related conversations but never found those. It looks like the first one matches what I was after most closely, and also more smartly than my approach! A node that that would filter out anything “already seen” would work generically and painlessly. It also seems that it was almost there, but then faced some issues I would have run into as well. I’ll up-vote that solution, hoping that work on it can be resumed. I think all that is missing in it to address my use case is an option to “ignore all results on first run” so that only emails coming in after activating a workflow will make it through (I’ll comment on that there).


1 Like