PT

Search

n8n Mautic integration: marketing automation in practice

Build an n8n Mautic integration with webhooks and the REST API, plus five workflows: AI lead scoring, behavior segments and CRM sync.

Gabriel Pedroso9 min read
Marketing automation with n8n and Mautic: adding AI to your funnel

Marketing automation keeps hitting the same wall: the tool does its own job well but can't talk to the rest of your stack. Mautic handles email, forms and nurturing; n8n connects it to your CRM, WhatsApp, spreadsheets and AI over the API, without plugins or custom glue code. With an n8n Mautic setup, nobody has to update the contact list by hand, and the funnel reacts to behavior in real time.

Why connect n8n to Mautic

Mautic is strong at what it sets out to do, but on its own it has no native connection to WhatsApp, Telegram, ERPs or your in-house APIs. n8n fills that gap. It builds bridges between Mautic and almost any tool that exposes an API.

CapabilityMautic aloneMautic + n8n
Email marketingYesYes, with conditional logic around it
Lead scoringPoint rulesPoints + AI classification
SMS / WhatsAppThrough a pluginThrough the Twilio node in n8n
ERP integrationLimitedCustom, over the API
Generative AINoYes (OpenAI, Anthropic)

Setting up the n8n Mautic connection

1. Enable the API and create credentials in Mautic

Turn the API on first. In Configuration > API Settings, set the API to enabled. Then create the access under Settings > API Credentials, choosing OAuth 2 (or Basic Auth for a user, if you are only testing). Save the Client ID and Client Secret, because n8n will need them.

2. Run n8n (cloud or self-hosted)

  • Self-hosted (full control): Docker on your own server. It's free and the data stays with you, though it takes some technical skill.
  • n8n Cloud (no server to manage): a service hosted by n8n itself, billed per execution and ready in minutes.

When the automation touches your contact database, self-hosting is usually the choice for privacy reasons, since the data never leaves your server.

3. Create the Mautic credential in n8n

In n8n, add a Mautic credential with your instance URL and the keys from step 1, then test the connection. From there, the Mautic node gives you ready-made operations (create contact, update contact, add to segment, edit points), and the Mautic Trigger listens for webhooks. The official n8n docs for the Mautic node list every available operation.

Workflow 1: AI-assisted lead scoring

Native scoring in Mautic is based on point rules. You can enrich it with n8n and an AI model that reads the lead's context before assigning points.

The workflow:

  1. The lead fills out a Mautic form.
  2. The Mautic Trigger hands the event to n8n through a webhook.
  3. An AI node (OpenAI or Anthropic) or an HTTP request evaluates the context: is this a buyer or someone who is just curious?
  4. The Mautic node edits the contact's points and adds the contact to the right segment.
  5. A hot contact enters a nurture campaign inside Mautic.

Here is a simple scoring model, purely as an illustration:

  • Company email address: +2 points
  • Visited the pricing page 3+ times: +3 points
  • Opened the last two campaigns: +2 points
  • Spent more than 5 minutes on the site: +1 point

With this n8n Mautic workflow, each lead gets sorted the moment it arrives instead of waiting for someone to review it.

Workflow 2: behavior-based segmentation

Instead of static segments, an n8n Mautic workflow reacts to events and adjusts the list in near real time.

For example, a contact who opened five or more emails in the last seven days moves to a high-interest segment. In n8n it looks like this:

  • Trigger: an email open event, captured by the Mautic Trigger
  • Logic: count recent opens by querying the Mautic API
  • Action: if the count passes the threshold, add the contact to the segment with the add to segment operation
  • Follow-up: Mautic fires the campaign tied to that segment

Workflow 3: AI content personalization

Each contact gets a custom-written email snippet, and you don't have to write ten variations by hand.

Picture a large database split into several segments. Instead of drafting one version per segment, the AI writes a personalized opening from the contact's data. A sample prompt that n8n could send to the model:

"Write an opening paragraph for a sales email. Recipient: {contact.name}, job title: {contact.title}, company: {contact.company}, segment: {contact.segment}. Professional and friendly tone, three lines at most."

In practice, n8n saves the generated text to a custom field on the contact, and the Mautic email template references that field with a token. Mautic still sends the email; n8n only fills in the content.

Workflow 4: two-way CRM sync

When the CRM is your source of truth, n8n keeps both sides up to date. The Mautic node pairs with the HubSpot, Salesforce and Pipedrive nodes.

EventAction
Contact created in the CRMCreate the contact in Mautic
Deal won in the CRMMove to the "Customer" segment in Mautic
Email opened in MauticUpdate engagement in the CRM
Contact deleted on one sideDelete it on the other (list hygiene and privacy)

Workflow 5: WhatsApp qualification

As an alternative to email, the Twilio node in n8n sends WhatsApp messages tied to Mautic.

  1. The lead fills out a Mautic form.
  2. n8n sends a message through Twilio: "Hi {name}, we got your message...".
  3. If the person replies, a webhook sends the event back and Mautic applies the "Replied" tag.
  4. The follow-up email goes out to the people who engaged.

To build the other side of this flow, see the Mautic WhatsApp integration guide.

Webhooks: the trigger behind every n8n Mautic workflow

A webhook lets Mautic push events to n8n the moment they happen, so n8n doesn't have to keep polling.

Mautic can send events such as:

  • Contact created, updated or deleted
  • Contact points changed
  • Email opened
  • Form submitted
  • Page visited

To set it up, go to Settings > Webhooks, create a webhook that points to the URL the Mautic Trigger generates in n8n, and tick the events you care about.

Limits and costs

  • Cost: a self-hosted n8n Mautic stack is free, and you pay for the server. The AI APIs and the email service are what can add up, depending on volume. If you choose n8n Cloud, it charges per execution.
  • Rate limits: respect the API limits of your Mautic server and use batch operations in n8n instead of bursts of calls.
  • Latency: the webhook is close to instant, but processing inside n8n can take a few seconds.
  • Debugging: n8n logs every execution, so use that to trace a failure before you blame the integration.

Security: protecting data in transit

When an n8n Mautic integration moves data between the two systems:

  • Always use HTTPS, behind a reverse proxy if you self-host (n8n Cloud has it built in)
  • Validate where each webhook comes from, using the secret or signature configured in Mautic
  • Never leave API keys exposed inside a workflow; use n8n credentials and environment variables
  • Keep audit logs in both systems

Frequently asked questions

Is n8n better than Zapier for integrating Mautic?

It depends on volume. Zapier is easier to start with. n8n wins when you need many workflows, control over your data and AI in the middle of the flow. Self-hosted n8n has no per-execution fee, so you only pay for the server. For a few occasional triggers, Zapier gets the job done with less effort.

Do I need to code to use n8n with Mautic?

Not for the basics. The Mautic node ships with ready-made operations (create contact, update contact, add to segment, edit points), so most of the work happens in the visual editor. Some JavaScript helps when you need to clean data or handle exceptions in more advanced workflows.

How long until the integration pays off?

The most concrete return shows up early: a lead gets a reply within seconds, at night or on the weekend, without anyone online, and nobody has to copy data between tools anymore. Conversion gains depend too much on context to promise a number, so measure your funnel before and after.

How do I debug a workflow that isn't working?

n8n stores every execution and lets you rerun it step by step, showing what went into and came out of each node. Check the Mautic logs too, and test the API call on its own before wiring it into the workflow. Before activating anything, run it in test mode with dummy data.

Does the integration work with Mautic 5 and Mautic 7?

Yes. n8n talks to Mautic through the REST API and webhooks, which both versions have. When you move to a new major version, recheck the credentials and one workflow of each type before trusting the rest, because small API changes can require adjustments. The Mautic 7 overview covers what changed in the new version.

Where to start

Don't build five workflows at once. Start with one n8n Mautic flow (lead capture, then scoring, then email) and leave it running. It has the best return, and building it shows you how the two tools fit together. Once it's stable, expand to a simple drip campaign and then to more advanced marketing automation patterns with n8n and AI.