Skip to main content

Secure web form to Odoo CRM lead creation with UTM tracking

Workflow preview

Workflow preview
100%
Secure web form to Odoo CRM lead creation with UTM tracking preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Web to Odoo Lead Funnel (UTM ready) Create records in Odoo from any webform via a secure webhook. The workflow validates required fields, resolves UTMs by name (source, medium, campaign) and writes...

Best for

  • Lead Generation automation workflows
  • Multimodal AI automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.webhook, n8n-nodes-base.merge, n8n-nodes-base.odoo, n8n-nodes-base.code, n8n-nodes-base.stickynote, n8n-nodes-base.executiondata, n8n-nodes-base.respondtowebhook, n8n-nodes-base.if

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Gaetano Castaldo.

Original n8n.io source

1.1 Workflow description

Title
Secure web form to Odoo CRM lead creation with UTM tracking
Workflow name
Secure web form to Odoo CRM lead creation with UTM tracking

# Web-to-Odoo Lead Funnel (UTM-ready)

Create crm.lead records in Odoo from any webform via a secure webhook.
The workflow validates required fields, resolves UTMs by name (source, medium, campaign) and writes standard lead fields in Odoo. Clean, portable, and production-ready.

Key features

  • Secure Webhook with Header Auth (x-webhook-token)
  • Required fields validation (firstname, lastname, email)
  • UTM lookup by name (utm.source, utm.medium, utm.campaign)
  • Clean consolidation before create (name, contact_name, email_from, phone, description, type, UTM IDs)
  • Clear HTTP responses: 200 success / 400 bad request

Prerequisites

  • Odoo with Leads enabled (CRM → Settings → Leads)
  • Odoo API Key for your user (use it as the password)
  • n8n Odoo credentials: URL, DB name, Login, API Key
  • Public URL for the webhook (ngrok/托管平台/reverse proxy). Ensure WEBHOOK_URL / N8N_HOST / N8N_PROTOCOL / N8N_PORT are consistent
  • Header Auth secret (e.g., x-webhook-token: <your-secret>)

How it works

  1. Ingest – The Webhook receives a POST at /webhook(-test)/lead-webform with Header Auth.
  2. Validate – An IF node checks required fields; if missing → respond with 400 Bad Request.
  3. UTM lookup – Three Odoo getAll queries fetch IDs by name:
    • utm.sourcesource_id
    • utm.mediummedium_id
    • utm.campaigncampaign_id
      If a record is not found, the corresponding ID remains null.
  4. Consolidate – Merge + Code nodes produce a single clean object:
    { name, contact_name, email_from, phone, description, type: "lead", campaign_id, source_id, medium_id }
  5. Create in Odoo – Odoo node (crm.lead → create) writes the lead with standard fields + UTM Many2one IDs.
  6. Respond – Success node returns 200 with { status: "ok", lead_id }.

Payload (JSON)

Required: firstname, lastname, email
Optional: phone, notes, source, medium, campaign

{
  "firstname": "John",
  "lastname": "Doe",
  "email": "[email protected]",
  "phone": "+393331234567",
  "notes": "Wants a demo",
  "source": "Ads",
  "medium": "Website",
  "campaign": "Spring 2025"
}

Quick test

curl -X POST "https://<host>/webhook-test/lead-webform" \
  -H "Content-Type: application/json" \
  -H "x-webhook-token: <secret>" \
  -d '{"firstname":"John","lastname":"Doe","email":"[email protected]",
       "phone":"+39333...", "notes":"Demo",
       "source":"Ads","medium":"Website","campaign":"Spring 2025"}'

Notes

  • Recent Odoo versions do not use the mobile field on leads/partners: use phone instead.
  • Keep secrets and credentials out of the template; the user will set their own after import.
  • If you want to auto-create missing UTM records, add an IF after each getAll and a create on utm.*.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Webhook - Lead Webform

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 1

Block 2 - Merge

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3.2

Block 3 - Create Lead

Type / Role
n8n-nodes-base.odoo - odoo
Config choices
Version 1

Block 4 - Prepare Request

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 5 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 6 - Execution Data

Type / Role
n8n-nodes-base.executionData - executionData
Config choices
Version 1.1

Block 7 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 8 - UTM: Get Source ID

Type / Role
n8n-nodes-base.odoo - odoo
Config choices
Version 1

Block 9 - UTM: Get Medium ID

Type / Role
n8n-nodes-base.odoo - odoo
Config choices
Version 1

Block 10 - UTM: Get Campaign ID

Type / Role
n8n-nodes-base.odoo - odoo
Config choices
Version 1

Block 11 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 12 - Success

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.4

Block 13 - Required data missing?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 14 - Bad Request

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.4

Block 15 - Source ID Validation

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 16 - Medium ID Validation

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 17 - Campaign ID Validation

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 18 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 19 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Secure web form to Odoo CRM lead creation with UTM tracking
Complexity advanced
Nodes 19
Categories Lead Generation, Multimodal AI
Author Gaetano Castaldo
Published 12 Aug 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/7289/7289.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Secure web form to Odoo CRM lead creation with UTM tracking do?

Web to Odoo Lead Funnel (UTM ready) Create records in Odoo from any webform via a secure webhook. The workflow validates required fields, resolves UTMs by name (source, medium, campaign) and writes...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Lead Generation, Multimodal AI use case.