Gmail Node labeling wrong message ID

I’m building a gmail workflow to automatically add labels based on subject keywords. I have the Gmail Node to get all, then an if statement, to identify the keywords then the gmail node to add the label. For the false path on the IF node, I insert another IF node with a different set of keywords that leads to another gmail node to add a different label.

The issue I’m having is in the last step the Gmail node keeps labeling the wrong message ID. In the screenshot below, you can see that the input message ID is different than the output message ID. Am I doing something wrong? Maybe I can’t do multiple IF statements?

What is the error message (if any)?

Please share the workflow

(Select the nodes and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow respectively)

Share the output returned by the last node

Information on your n8n setup

  • n8n version:
  • Database you’re using (default: SQLite):
  • Running n8n with the execution process [own(default), main]:
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]:

Hey @JasonA,
welcome to the community :tada:

In your Gmail labeling nodes you are using expressions like this

image

Could you instead try to map the incoming input id directly like this

image

That looks to have done the trick. Thank You!

1 Like

Great to hear. It would be great if you mark my post as a solution so other community members can see it.

1 Like

Didnt work for me, i have a node that gets the one message with a label, then gets attachments and append to google sheets and then another node to remove the label, but i get same issue with the message id :frowning:

Hey @joelopezcuenca,

Could you pop open a new thread and fill out the template so we can take a look?

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