Centralized Solution for Multiple Gmail Accounts in n8n

Hi everyone,

I’ve developed a workflow in n8n that:

  1. Watches emails using a Gmail Trigger.
  2. Uses a Text Classifier to categorize emails (e.g., Leads, Qualified Leads, etc.).
  3. Adds labels to emails based on the classification.

This worked fine when I had just one Gmail account. However, I now need to add six more Gmail accounts, and I want to avoid creating six separate workflows.

I tried adding multiple Gmail Triggers in the same workflow and duplicating the logic for each account, but it quickly became unmanageable. Anytime I need to make a change, I would have to update everything for all accounts, which is time-consuming and error-prone.

Is there a way to:

  • Centralize the logic so I don’t have to duplicate it for each account?
  • Use dynamic inputs or parameters to handle multiple Gmail accounts within a single workflow?

Any guidance or best practices for handling this kind of scenario in n8n would be greatly appreciated!

Thanks in advance!

It looks like your topic is missing some important information. Could you provide the following if applicable.

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

Hi @Rohit_Gurav,

This looks like a similar question to this one here: Passing credentials as variables and this is the solution that’s being suggested:

There’s also a feature request to Allow expression for credential selection which might be relevant. Hope that helps :star:

Even if try this solution how do I set up trigger as I have 6 primary email account and they might receive e-mails simultaneously