Skip to content

Gmail Trigger doesn't run on messages sent to self #19302

Description

@immortaly007

Bug Description

If I sent an e-mail to myself using gmail, the gmail trigger doens't run, since it doesn't consider messages sent to self as new e-mails. Gmail itself does (the messages appear in the inbox, as well as the "sent" folder), so this is confusing.

My use case is that I have a wordpress instance with a contact form, that sends the e-mails using my gmail account. If the contact form is filled in, the e-mail get sent to the account itself, so that we can see them.

To Reproduce

  1. Have a gmail account and link the gmail trigger to it (e.g. my-mail@domain.com)
  2. Create a gmail trigger for this account, using any settings you like.
  3. Send an e-mail to yourself from this account
  4. I now expect the gmail trigger to run, but it doesn't.

Expected behavior

I expect the gmail trigger to trigger on all new messages in the inbox, regardless of if they're being sent from the same account.

I suspect that this line is the culprit:

if (node.typeVersion > 1.2 && fullMessage.labelIds?.includes('SENT')) {

I would like to either be able to configure this somehow (e.g. an extra boolean setting "process all mails in the inbox"), or that just any mails that appear in the inbox are processed.

I think the "filter sent e-mails feature" was added based on this issue: #16029
But this might be an unintended side-effect for this.

Debug Info

Debug info

core

  • n8nVersion: 1.109.2
  • platform: docker (self-hosted)
  • nodeJsVersion: 22.19.0
  • database: sqlite
  • executionMode: regular
  • concurrency: -1
  • license: enterprise (production)
  • consumerId: 19380fa4-77b2-44dc-a710-4a40e5e92f84

storage

  • success: all
  • error: all
  • progress: false
  • manual: true
  • binaryMode: memory

pruning

  • enabled: true
  • maxAge: 336 hours
  • maxCount: 10000 executions

client

  • userAgent: mozilla/5.0 (x11; linux x86_64) applewebkit/537.36 (khtml, like gecko) chrome/138.0.0.0 safari/537.36
  • isTouchDevice: false

Generated at: 2025-09-08T11:46:37.667Z

Operating System

Debian (server)

n8n Version

1.109.2

Node.js Version

22.19.0

Database

SQLite (default)

Execution mode

main (default)

Hosting

self hosted

Metadata

Metadata

Assignees

No one assigned

    Labels

    in linearDEPRECATEDteam:nodesIssue is with the Nodes team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions