All Templates
Revenue Operations • Advanced • 4 n8n workflows

HubSpot Intelligent Lead Routing & Response System

Four connected n8n workflows for durable inbound intake, email validation, HubSpot owner routing, AI scoring and drafts, controlled first responses, and operational recovery.

0

One system, 4 connected workflows

Start with the complete package and setup directions. The preview below shows the entry workflow. Import every listed workflow separately, then connect their references in your n8n instance.

Get all 4 workflows Read the setup directions

Entry workflow preview

Powered by n8n.io

Read the architecture, decision rules, and exception handling in the source blueprint .

Continue with the related architecture guide .

How it works

What this system does

Turn inbound inquiries into validated, owned HubSpot leads with explainable scoring and controlled first responses. Four connected n8n workflows use ZeroBounce for email validation, OpenAI for scoring and drafting, Slack for optional Hot lead alerts, Resend for sending, and PostgreSQL for durable queue and duplicate-send controls.

This is the executable counterpart to the Intelligent Lead Routing & Response blueprint. It also supplies the intake and routing layer within the Revenue Operations Intelligence architecture.

The four-workflow lifecycle

  1. Intake: workflow 01 normalizes an authenticated backend payload, stores it before returning 202, and starts the worker asynchronously.
  2. Process: workflow 02 validates email, resolves or creates the contact, preserves existing ownership, assigns unowned contacts through atomic rotation, scores the inquiry, and saves a draft.
  3. Prepare properties: workflow 03 is a one-time manual setup for custom HubSpot fields.
  4. Operate: workflow 04 records failures and detects stalled jobs, review holds, alert failures, and logging holds.

Classification and send permission

The model supplies bounded fit, intent, and urgency scores with evidence. Code determines Hot/Warm/Cold and applies separate sending gates. Cold, low-confidence, unsupported, opted-out, stale, and excluded customer inquiries do not auto-send. A Warm classification alone is not permission to send.

Existing owners and nonempty contact fields are preserved. New unowned contacts rotate across configured available reps; availability is a configuration flag, not live calendar presence. Immediately before sending, the worker rechecks the email, owner, suppression, validation, lifecycle, and response state.

Resend acceptance is recorded separately from confirmed delivery. The sent subject/body is logged in HubSpot afterward. Stored provider requests, send guards, bounded retries, and a per-email cooldown reduce duplicate sends; uncertain provider outcomes require operator reconciliation rather than a full workflow replay.

Important test behavior

Dry run still updates HubSpot and makes paid validation and AI API calls. It blocks email sending. Defaults are dry_run: true, auto_send_enabled: false, and Slack disabled. Use a sandbox CRM and test inboxes before activating the workflows.

The supplied validation report records 64 local checks. Live n8n execution, PostgreSQL functions and concurrent load, vendor credentials and responses, actual delivery, and model quality against your services and labeled leads were not verified by that report.

Connect attribution separately

Add the GA4 & HubSpot Lead Attribution System when you also need source preservation and aggregate traffic reporting. Lead routing creates or updates contacts; attribution looks up existing contacts and retries while creation is pending. They are separate workflow packages with separate event contracts.

How to use

Before you start

  • A current compatible n8n instance and dedicated PostgreSQL 14+ application database with an encrypted connection.
  • A HubSpot sandbox or controlled test contacts and the required contact, schema, and email-activity permissions.
  • ZeroBounce and OpenAI API credentials. Test runs can incur API charges.
  • Resend with a verified sender domain when enabling email; Slack credentials only if alerts are enabled.
  • Your approved service catalog, company details, HubSpot portal ID, real owner IDs, rep profiles, and a trusted form backend.

Import and configure

  1. Download the complete package, extract it, and read the full setup manual. Import the four .n8n.json files individually into n8n and save each workflow. Supporting SQL and JSON files are not workflow imports.
  2. Run database-setup.sql in the dedicated application database, not against n8n internal tables. Apply the documented role grants where needed. Run database-smoke-test.sql in a sandbox; it rolls back.
  3. Rebind every placeholder credential: Form Header Auth, Postgres, HubSpot Header Auth, ZeroBounce Query Auth, OpenAI Header Auth, Resend Header Auth, and optional Slack Header Auth. Store secrets in n8n credentials.
  4. Run workflow 03 manually to create missing custom properties. Resolve incompatible existing definitions before proceeding and keep this workflow manual.
  5. Edit Configuration in workflow 02. Replace company information, approved services, verified sender, HubSpot portal ID, and rep profiles using actual HubSpot owner IDs. Leave dry_run: true, auto_send_enabled: false, and Slack off for initial sandbox checks. Required placeholders deliberately block processing.
  6. In workflow 01, Start Lead Worker, select imported workflow 02. Keep Wait for Sub-Workflow Completion off and permit intake calls in the worker settings.
  7. Select workflow 04 as the error workflow for workflow 02, and optionally for 01. These references are specific to your n8n instance and must be set after import.
  8. If needed, configure Hot lead Slack alerts in workflow 02 and independently configure operations Slack in workflow 04. Set real channel and member IDs.
  9. Save, publish, or activate 01, 02, and 04 as your n8n version requires in the test environment. Workflow 03 stays manual. Activation enables the production webhook and recovery schedules.
  10. Send the sample payload from your trusted backend using an inbox you control. Inspect the queue, contact, owner, scores, saved draft, and execution. Dry run still writes CRM records and uses paid APIs.
  11. After acceptance checks, set both dry_run: false and auto_send_enabled: true for live first responses. Existing dry-run drafts are not automatically sent when these switches change.

Form contract

Your backend sends POST https://YOUR_N8N_HOST/webhook/revops-l1-001-inbound using the configured header secret, such as X-Lead-Webhook-Secret. Keep that secret out of browser code.

Required fields are submission_id (a stable UUID) and email. Optional context includes name, company, phone, role, message, service interest, budget, timeline, form ID, and page URL. response_requested must be the actual JSON boolean true, recorded by your trusted backend, before the sending gates can permit a reply. Missing, false, or the string "true" prevents auto-send.

Retry the same inquiry with the same UUID and payload. Accepted and identical duplicate submissions return 202; conflicting reuse returns 409; malformed input returns 400. Native HubSpot form or webhook events need an adapter to this contract.

Validate before rollout

Test valid Hot and Warm leads, invalid or risky mailboxes, Cold and low-confidence leads, absent or unavailable owners, existing customers, opted-out contacts, unsupported services, and duplicate payloads. Confirm that dry run saves drafts without email, that a changed owner or suppression state blocks a pending send, and that database rotation behaves correctly under concurrency.

Inspect provider acceptance separately from delivery. Confirm that CRM logging failure does not resend an accepted email, and reconcile uncertain provider results using the saved request and idempotency key. The complete manual explains recovery. Delivery, bounce, complaint, reply tracking, and subscription integrations remain separate work.

Changing global configuration does not reliably cancel running or waiting executions. Use the documented CRM suppression controls and cancel pending executions when an immediate stop is needed.

Pair with GA4 and HubSpot attribution

Use the attribution system for source evidence and GA4 reporting. Have your trusted backend adapt a successful form submission to both contracts and share the same submission_id; attribution also requires its own stable event_id per producer. Configure the packages separately and test matching after contact creation. Importing them does not automatically connect their webhooks.

Read the Intelligent Lead Routing & Response blueprint for the architecture, and the Revenue Operations Intelligence blueprint for the broader process.

Reviewed duplicate cleanup

Use the HubSpot Duplicate Detection & Approved Merge System for separately configured duplicate review and cleanup. It imports inactive with merge execution disabled. Before combining the packages, test how CRM references reconcile the resulting record ID after an approved merge.

Proposal follow-up

The HubSpot Ghosted Proposal Follow-Up & Recovery System adds separately configured five-to-seven-day check-ins, high-value approvals, and reply tasks. It imports inactive with SMTP delivery disabled.

Get the complete automation system

Download all 4 workflows and the supporting files together. Extract the ZIP, then import each .n8n.json file separately. The SQL, JavaScript, and other JSON files support setup and testing; they are not n8n workflow imports.

Download complete package (ZIP)

4 connected n8n workflows

All import inactive. Follow the setup directions before activation; run property setup manually.

  1. 01 · Inbound intake

    Authenticates and validates backend submissions, durably queues each inquiry, returns an acknowledgment, and starts workflow 02 asynchronously.

    01-inbound-intake.n8n.json
    Download workflow 01
  2. 02 · HubSpot lead worker

    Validates email with ZeroBounce, creates or updates HubSpot contacts, preserves existing owners, scores and drafts with OpenAI, and controls optional Slack alerts and Resend first responses.

    02-hubspot-lead-worker.n8n.json
    Download workflow 02
  3. 03 · HubSpot property setup

    Run manually once to create missing custom contact properties and check existing definitions for compatibility.

    03-hubspot-property-setup.n8n.json
    Download workflow 03
  4. 04 · Errors and stalled jobs

    Records automatic failures and scans for queued backlogs, stalled jobs, review holds, failed Hot alerts, and pending CRM logging. Operations Slack is separately configurable.

    04-errors-and-stalled-jobs.n8n.json
    Download workflow 04

Setup, integration, and validation files

  • Full setup and recovery manual

    Complete credential instructions, scoring and sending gates, webhook contract, acceptance cases, and recovery without duplicate emails.

    README.md
  • PostgreSQL schema setup

    Required dedicated PostgreSQL 14+ application schema with durable jobs, transactional owner rotation, and send guards.

    database-setup.sql
  • Database sandbox smoke test

    Sequential database checks that roll back. Execute in your sandbox and separately test concurrency.

    database-smoke-test.sql
  • HubSpot property definitions

    Schema reference for the custom contact fields. This is not an n8n workflow import.

    hubspot-property-definitions.json
  • Sample inbound webhook payload

    Example trusted-backend payload. Replace sample identities with test inboxes you control and retain the submission UUID on retries.

    sample-webhook-payload.json
  • Supplied validation report

    Records 64 passing source-package checks and the live n8n, database, vendor, delivery, and model-quality checks still required.

    validation-report.json