Send each enquiry to the right department with n8n

One n8n workflow for every department. Each enquiry becomes a HubSpot contact owned by that department's person, with a follow-up task.

Updated 18 Nov 2026

What it does

Each department has its own Trevilo rule, all sending to this one workflow with the department's name in the address. The workflow creates or updates the HubSpot contact owned by that department's person and gives them a follow-up task. A department name the workflow does not know goes to your "Needs sorting" person.

You need

  • n8n, cloud or self-hosted. Tested on n8n 2.48.

  • A HubSpot private app access token that can read and write contacts and create tasks.

  • The HubSpot owner ID of each department's person (HubSpot: Settings, Users and Teams).

  • The workflow file. Download it from this page.

Set it up

  1. In n8n, choose Import from file and pick the workflow file you downloaded.

  2. Open the Trevilo enquiry step and copy its Production URL.

  3. In the same step, create a Header Auth credential. Name: X-Webhook-Key. Value: a long random key you make up (a password manager can generate one).

  4. In Trevilo, add one rule per department, for example by keyword or by what the enquiry is about. Send it to a new n8n connection with the Production URL plus ?department= and the department's name, for example ?department=sales. Set the connection's login to API key in a header, header name X-Webhook-Key, and the same key.

  5. Open Pick the owner. In departmentOwners, list each department name with its owner ID, for example {"sales": "12345", "accounts": "67890"}. Set needsSortingOwner to the person who sorts everything else.

  6. In Create or update contact, create a HubSpot App Token credential with your token, and use it in Create task too.

  7. Publish the workflow, then send a test enquiry through each department's rule.

Good to know

  • n8n refuses any request without your key, so only your Trevilo connection can start the workflow.

  • If Trevilo delivers the same enquiry again, the workflow ignores the repeat.

  • Department names ignore capitals and spaces, so Sales and sales are the same department.

  • Enquiries without an email address are ignored.

  • Rules based on what an enquiry is about need the Smart or GrowthPlus plan. Keyword rules work on every plan. See How rules work.

  • Each delivery to n8n uses 1 credit. See Credits.

Send each enquiry to the right department with n8n | Trevilo help