How to process incoming emails one by one

Hi. How to process incoming emails if there are a lot of old emails (for several years) in the mailbox? If I set the email rules “[“ALL”, [“SINCE”, “February 18, 2025”]]”, then when I stop and restart the workflow, the system starts processing all emails again. How can I make sure that only new emails are processed?

Information on your n8n setup

  • **n8n version: 1.70.1
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • **Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • **Operating system: Ubuntu 22.04

There are several approaches:

  • Use the Remove Duplicates node to filter out emails you have already processed.
  • Move processed emails out of the inbox.
  • Apply a tag to processed emails and ignore those in future executions.

Thank you. Can you give a little more detail?

  • Move processed emails out of the inbox.
    I don’t have Gmail, it’s not a very popular email.

  • Apply a tag to processed emails and ignore those in future executions.
    How to do this?

  • Use the Remove Duplicates node to filter out emails you have already processed.
    After the imap node, put this Remove Duplicates? Does the system store data about processed letters somewhere?

That’s gmail specific - the equivalent on another service would be to move the email to a folder.

Yes - correct. n8n has a database where it stores processed IDs. See the documentation that I linked to :slight_smile:

In the standard IMAP node there is only - mark as read.

Thanks for your help.

1 Like

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