How to automatically apply Gmail labels to emails from specific domains for multiple users in organization?

Hi everyone,

I’m trying to build an automation workflow that automatically applies Gmail labels to emails based on sender domains, and I need this to work for multiple users in my organization.

What I’m trying to achieve:

  1. When a new project is created in our system, I retrieve the client’s domain (e.g., client-company.com)

  2. Create a Gmail label with the client’s name

  3. Automatically apply this label to all emails from @client-company.com for specific team members working on that project

My questions:

  • Is it possible to create Gmail filters/labels programmatically for multiple users in a Google Workspace organization without each user manually authorizing access?

  • Should I use Domain-Wide Delegation for this? If so, what are the required OAuth scopes?

  • Has anyone successfully implemented this with automation tools like n8n, Zapier, or (URL Removed by Staff)?

  • Or do I need to build a custom backend application with the Gmail API to achieve this?

What I’ve tried:

I’m currently using n8n and can successfully:

  • Create labels using the Gmail API (gmail.labels.create)

  • Create filters for a single authenticated user (gmail.users.settings.filters.create)

However, I’m stuck on how to:

  • Apply these filters/labels to multiple team members’ Gmail accounts without requiring each person to manually authenticate

  • Manage this at scale for our organization

Technical details:

  • We have Google Workspace

  • Team size: 5-15 people per project

  • Need to automate label creation for dozens of clients

Is Domain-Wide Delegation the right approach here? Or is there a simpler way to manage Gmail labels/filters across multiple users in an organization?

Any guidance, documentation links, or code examples would be greatly appreciated!

Thanks in advance!

HI

Have you thought about enable the Google groups in the admin control panel and then Enable Shared Labels: A Group owner/manager enables shared labels in Google Groups settings for a specific group, making labels visible and manageable for all members.

  • Apply Labels: Members can then apply these shared labels to group-related emails, or you can create filters within the group settings to automatically apply them.

Use labels to categorize group content

Third-Party Tools (e.g., Gmelius, cloudHQ)

  • Automated Routing: Set up powerful automations (triggers like keywords, sender, etc.) to automatically apply these shared labels to incoming mail, routing it correctly for everyone.

  • Nested Labels: Create hierarchical structures (e.g., “Support” > “Agent A”) for detailed task management.

1 Like