n8n

How to Sync Mautic Contacts for Lead Management?

Capture student events, keep Mautic contacts up to date, and control email preferences with one connected flow. Great for teams that sell courses or memberships and need clean contact data, clear tags, and fast updates.

A webhook receives a JSON payload from your app. The request is routed by type, then the email is searched in Mautic. Names are split into first and last name. If no match is found, a new contact is created. If a contact exists, fields are updated. The flow adds a tag with the course name for simple segmentation. A flag in the payload controls opt out and opt back in actions by applying or removing an unsubscribe tag. All steps merge clean data before Mautic writes happen, so records stay consistent.

You only need a Mautic account and an n8n instance. Connect Mautic with OAuth2 in n8n, point your source app to the webhook URL, and send a test event with the expected student fields. Expect faster updates, fewer errors, and clear tags that drive targeted campaigns. Use this for enrollments, profile edits, purchases, and marketing preference changes.

What are the key features?

  • Webhook intake captures student and event data from any system that can send HTTP POST
  • Switch node routes requests by event type so each path runs only what it needs
  • Email search in Mautic finds the right contact before changes are applied
  • Name splitter converts a full name into first and last name fields
  • Create or update logic keeps records current without duplicates
  • Course based tagging adds the course name as a tag for easy segmentation
  • Unsubscribe and resubscribe control uses a flag to set or remove the unsubscribe tag
  • Merge step assembles clean student data and the found contact id for reliable writes

What are the benefits?

  • Reduce manual contact updates from hours each week to a few minutes
  • Automate up to 90 percent of repetitive Mautic edits
  • Improve data quality by 95 percent with email based matching and name parsing
  • Connect your app to Mautic seamlessly with a single webhook
  • Segment by course tags for precise campaigns and reporting
  • Handle higher enrollment volume without adding staff

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with Mautic. See the Tools Required section above for links to create accounts with these services.
  3. Open any Mautic node in the workflow. In the Credential to connect with dropdown, click Create new credential and follow the on screen steps to connect with OAuth2. Name the credential clearly so your team can reuse it.
  4. In your Mautic instance, make sure API access is enabled and that your user has permission to read and write contacts.
  5. Select the Webhook node in n8n and copy the Production URL. Paste this URL into your source app that will send events to the webhook.
  6. Review the expected JSON fields in your source app. Provide student.email, student.name or student.firstName and student.lastName, student.course.name, and unsubscribe_from_marketing_emails when relevant.
  7. Check the Switch Webhook Types node. Adjust the conditions so they match your event names if your payload uses custom types.
  8. Send a test POST request from your app or a REST client to the webhook URL. Use a real email so you can verify the result in Mautic.
  9. In Mautic, confirm that a contact was created or updated. Check first name, last name, and email. Verify that the course tag appears on the contact.
  10. Test the unsubscribe flag. Send a request with unsubscribe_from_marketing_emails set to true and confirm the unsubscribe tag is added. Send another with false to confirm it is removed.
  11. If no contact is found or created, check the Find User node search value, verify the webhook payload keys, and confirm your Mautic credential is connected and not expired.
  12. Once tests pass, turn the workflow active in n8n so events are processed in real time.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

Mautic

Sign up

Self-hosted (open source): $0 (API available).

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.