## Introduction
In fast-growing startups or scale-ups, employee questions bombard the operations team daily. These questions often pertain to different departments — HR inquiries, IT support, payroll, or facility issues. Without an organized routing system, important requests get delayed or lost, decreasing overall employee satisfaction and increasing operational overhead.
This article explains how to build an automated routing workflow for employee questions using n8n, an open-source workflow automation tool. The solution benefits operations teams by ensuring that every employee query reaches the right team without manual triage. It also benefits employees by reducing wait times for responses.
## Tools and Services Integrated
– **n8n:** The automation platform to build the workflow
– **Gmail:** To receive employee questions sent via email
– **Google Sheets:** To maintain a lookup table of keywords and corresponding department emails
– **Slack:** To notify relevant teams when a new question arrives
## Use Case Overview
Employees submit questions by sending emails to a central mailbox like `questions@company.com`. The workflow listens for new incoming emails, analyzes the content to detect keywords or question categories, matches these to the right teams based on a configurable Google Sheet mapping, and routes (forwards) the email automatically to the right team’s email address. Additionally, Slack messages notify team channels about incoming questions they should address promptly.
## Step-by-Step Technical Tutorial
### Step 1: Set up the Gmail Trigger
– In n8n, create a new workflow.
– Add the **Gmail Trigger** node configured to listen for new emails arriving at your shared mailbox (`questions@company.com`). Ensure n8n has OAuth credentials with access to this mailbox.
– Configure the trigger to only react to unread emails with a subject or body content.
### Step 2: Extract Email Content
– Add a **Set** or **Function** node (depending on preferred scripting) to extract important data from the incoming email.
– Extract fields such as `From`, `Subject`, `Body (Plain Text)`, and `Date`.
– You will use `Body` to identify keywords.
### Step 3: Fetch Routing Configuration from Google Sheets
– Create a Google Sheet named `RoutingConfig` with columns:
  – `Keyword`
  – `DepartmentEmail`
  – `SlackChannel`
Example rows:
| Keyword | DepartmentEmail         | SlackChannel  |
|———|————————|—————|
| payroll | payroll@company.com    | #payroll-team |
| it      | itsupport@company.com  | #it-support   |
| hr      | hr@company.com         | #hr           |
| facilities | facilities@company.com | #facilities |
– Add a **Google Sheets** node in n8n configured to read this sheet.
– The node should fetch all rows to perform keyword matching.
### Step 4: Match Keywords to Departments
– Add a **Function** node where you parse the email body, lowercase the content, and iterate through each row from the Google Sheet.
– For each keyword, check if it exists in the email body text.
– If multiple keywords match, you may choose to prioritize or route to multiple teams.
– Collect the matched departments’ emails and Slack channels.
### Step 5: Forward Email to Routing Address
– For each matched department email (could be one or multiple), add a **Gmail** node set to send an email.
– The forwarded email should include:
  – Original `From` address,
  – Original subject (prefixed with “[Routed]” or other tagging),
  – Full original email body,
  – Any additional routing metadata.
### Step 6: Post Notifications to Slack Channels
– Add a **Slack** node for each matched Slack channel.
– Send a structured message with the email subject, snippet, and a link or mention to follow up.
– Use Slack OAuth token with proper permissions.
### Step 7: Mark Original Email as Read or Label
– Finally, add a **Gmail** node to mark the original email as read or move it to a ‘Routed’ label.
– This avoids duplicated processing.
### Step 8: Error Handling and Logging
– Use **Error Trigger** nodes to catch processing failures.
– Log errors to a designated Google Sheet or Slack channel for monitoring.
– Consider retry mechanisms in case of service outages.
## Common Errors and Tips
– **Google Sheets API limits:** Cache routing data periodically to reduce API calls if email volume is high.
– **Keyword overlap:** If a message contains multiple keywords overlapping departments, design your logic on priority or forward to multiple teams.
– **Email forward loops:** To avoid emails stuck in loops, add tagging to forwarded messages and filter them out in the Gmail trigger.
– **Slack rate limits:** Batch notifications if question volume spikes.
## Adapting and Scaling the Workflow
– **Dynamic keyword updates:** Non-technical staff can maintain the Google Sheet, enabling agile modification of routing without changing the workflow.
– **Additional input channels:** Extend the workflow to support Slack message triggers, forms (e.g., Google Forms), or chatbots.
– **Analytics:** Add nodes to log routing data to a database or BI tool for operational insights.
– **Multi-language support:** Add natural language processing nodes for better question classification.
## Summary
Routing employee questions to the right teams manually wastes time and risks delays. With n8n, you can automate this using Gmail, Google Sheets, and Slack integrations to build a flexible, maintainable routing workflow. This automation improves employee experience by speeding up responses, while empowering operations teams to triage questions efficiently.
**Bonus Tip:** Use n8n’s built-in scheduling to periodically refresh the Google Sheets cache or run batch review reports, ensuring smooth operation without manual checks.