n8n Workflow
Intermediate

Sync WooCommerce Customers with Mautic

Automate contact synchronization between WooCommerce and Mautic. This workflow creates or updates Mautic contacts whenever a customer is added or updated in your WooCommerce store.

Overview

Automatically syncs customer data from WooCommerce to Mautic, creating new contacts or updating existing ones to maintain a consistent and up-to-date marketing database.

🔄 Description & Use Case

This workflow automates the process of keeping your Mautic marketing contacts synchronized with your WooCommerce customers. Whenever a new customer is created or an existing customer's details are updated in WooCommerce, this workflow will automatically create a corresponding contact in Mautic or update the existing one.

Workflow Steps:

  1. Trigger: The workflow is initiated by the Customer Created or Updated event in WooCommerce.
  2. Check for Existing Contact: It takes the customer's email from the WooCommerce data and uses the Mautic node to search if a contact with that email already exists in your Mautic instance.
  3. Conditional Logic: An If node checks the result from the previous step.
    • If True (Contact is New): If the search returns no contact ID, it means the customer is new to Mautic. The workflow then proceeds to the 'Create Contact' branch.
    • If False (Contact Exists): If a contact ID is found, the workflow proceeds to the 'Update Contact' branch.
  4. Create or Update in Mautic:
    • Create Contact: A new contact is created in Mautic using the customer's first name, last name, email, and company from WooCommerce.
    • Update Contact: The existing Mautic contact is updated with the latest first and last name from WooCommerce.

✅ Real-World Use Cases:

  • Marketing Automation: Ensure your Mautic campaigns and segments are always populated with the most current customer information from your e-commerce store.
  • Data Consistency: Eliminate manual data entry and reduce errors by maintaining a single source of truth that is automatically synchronized across platforms.
  • Customer Onboarding: Instantly enroll new WooCommerce customers into a Mautic welcome series or onboarding campaign to improve customer engagement from day one.
  • Personalized Communication: Use up-to-date customer data in Mautic to send targeted, personalized marketing communications that resonate with your audience.

Instructions

Basic steps

  1. Download workflow JSON
  2. Import into n8n
  3. Configure node parameters as needed
  4. Test and enable the workflow

💡 Tips

After importing, verify all connectors and credentials match your environment.

Preview

Workflow Visualization

5 nodes
100%
Check for ExistingmauticIf NewifCreate ContactmauticUpdate ContactmauticCustomer Created or UpdatedwooCommerceTrigger

Nodes

1

Check for Existing

mautic

v1
2

If New

if

v1
3

Create Contact

mautic

v1
4

Update Contact

mautic

v1
5

Customer Created or Updated

wooCommerceTrigger

v1

Statistics

Total nodes:5
Disabled nodes:0
Node types:3
Connections:3
View full JSON structure
{
  "nodes": [
    {
      "name": "Check for Existing",
      "type": "n8n-nodes-base.mautic",
      "position": [
        280,
        480
      ],
      "parameters": {
        "options": {
          "search": "={{$json[\"email\"]}}"
        },
        "operation": "getAll",
        "authentication": "oAuth2"
      },
      "credentials": {
        "mauticOAuth2Api": {
          "id": "54",
          "name": "Mautic account"
        }
      },
      "typeVersion": 1,
      "alwaysOutputData": true
    },
    {
      "name": "If New",
      "type": "n8n-nodes-base.if",
      "position": [
        460,
        480
      ],
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{$json[\"id\"]}}",
              "operation": "isEmpty"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "name": "Create Contact",
      "type": "n8n-nodes-base.mautic",
      "position": [
        680,
        320
      ],
      "parameters": {
        "email": "={{$node[\"Customer Created\"].json[\"email\"]}}",
        "company": "={{$node[\"Customer Created\"].json[\"billing\"][\"company\"]}}",
        "options": {},
        "lastName": "={{$node[\"Customer Created\"].json[\"last_name\"]}}",
        "firstName": "={{$node[\"Customer Created\"].json[\"first_name\"]}}",
        "authentication": "oAuth2",
        "additionalFields": {}
      },
      "credentials": {
        "mauticOAuth2Api": {
          "id": "54",
          "name": "Mautic account"
        }
      },
      "typeVersion": 1
    },
    {
      "name": "Update Contact",
      "type": "n8n-nodes-base.mautic",
      "position": [
        680,
        580
      ],
      "parameters": {
        "options": {},
        "contactId": "={{$json[\"id\"]}}",
        "operation": "update",
        "updateFields": {
          "lastName": "={{$node[\"Customer Created or Updated\"].json[\"last_name\"]}}",
          "firstName": "={{$node[\"Customer Created or Updated\"].json[\"first_name\"]}}"
        },
        "authentication": "oAuth2"
      },
      "credentials": {
        "mauticOAuth2Api": {
          "id": "54",
          "name": "Mautic account"
        }
      },
      "typeVersion": 1
    },
    {
      "name": "Customer Created or Updated",
      "type": "n8n-nodes-base.wooCommerceTrigger",
      "position": [
        100,
        480
      ],
      "webhookId": "5d89e322-a5e0-4cce-9eab-185e8375175b",
      "parameters": {
        "event": "customer.updated"
      },
      "credentials": {
        "wooCommerceApi": {
          "id": "48",
          "name": "WooCommerce account"
        }
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "If New": {
      "main": [
        [
          {
            "node": "Create Contact",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Update Contact",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check for Existing": {
      "main": [
        [
          {
            "node": "If New",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Customer Created or Updated": {
      "main": [
        [
          {
            "node": "Check for Existing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Actions

Share
Categories:
Tags:
ifwoocommercetriggermautic

Technical Specs

Complexity:
Intermediate
Node Count:
5 nodes
Published:11 months ago
Updated:4 months ago

Compatibility

Platform:
N8N Cloud & Self-hosted
Min Version:
N8N v1.0.0+
Supports cloud and self-hosted deployment

License

This workflow template follows MIT license, you can freely use, modify and distribute.

Please comply with relevant third-party service terms when using.

Related Workflows