Preserve email data through Gmail Add Label nodes

Question

Is it possible to preserve email data through a Gmail Add Label node?

My workflow

I have a workflow that is using different text classifiers to add Gmail labels. Then I want to proceed to further analysis, such as analyzing subject and body to create task, forward invoices, add to Notion database etc, where the labels are guiding the MCP Server as to what tool to use for this process.

But my problem is that the Gmail Add Label nodes only outputs what the Gmail API needs to add the labels, and there is no way in those nodes to output any other data.

Would I then have to add a Set node between each Text Classifier output and each Gmail Add Label node to preserve the email data to be used downstream?

Not sure how to add just that part of the workflow and anonymize it. But I hope my question is clear enough to get guideline about how to solve this.

Using the latest n8n Community Edition on Hetzner.

Thanks!!

1 Like

Hello @westis,

Adding a Set node is definitely a good idea because it allows you to pass the essential fields you want to process next.

Let’s see if it works properly :slight_smile:

In the downstream

I believe you still can use the expression something like
{{ $('Gmail Trigger').item.json.Subject }}

to get the email data from begining.

Here is an example workflow. After the Gmail labels, I can’t access any email data before those nodes… How can I still access the original email data downstream after the add label nodes?!

I use the same workflows and able to get those data.

Can you share a screenshot about what’s on your end?

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