AutomationFlowsGeneral › Assign Zammad Users to Organizations Based on Email Domain

Assign Zammad Users to Organizations Based on Email Domain

BySirhexalot @sirhexalot on n8n.io

This n8n workflow automates the assignment of existing users to organizations in Zammad based on their email domains, utilizing Zammad’s "domain-based assignment" feature.

Event trigger★★★★☆ complexity8 nodesZammad
General Trigger: Event Nodes: 8 Complexity: ★★★★☆ Added:

This workflow corresponds to n8n.io template #2588 — we link there as the canonical source.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "id": "QXhjTKmtXQyDDsAf",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Zammad - Assign organizations to existing users using \"domain based assignment\"",
  "tags": [],
  "nodes": [
    {
      "id": "d62c20b0-332a-4c7d-96cb-c19fe03bf151",
      "name": "When clicking \u2018Test workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        40,
        -80
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "9c23b715-1e88-4b3a-9146-377c9e0fc980",
      "name": "Organization has domain and is shared",
      "type": "n8n-nodes-base.if",
      "position": [
        560,
        260
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "772457dc-73a3-4b4e-b51c-27e3ae49b393",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.domain_assignment }}",
              "rightValue": ""
            },
            {
              "id": "52d2e881-7825-47b0-8a03-e643ca90f2cb",
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              },
              "leftValue": "={{ $json.domain }}",
              "rightValue": ""
            },
            {
              "id": "e932a847-3f96-4280-8fd2-7cbc45105b42",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.shared }}",
              "rightValue": ""
            },
            {
              "id": "1d2ea76a-3510-4bea-89e6-de68ae37c787",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.active }}",
              "rightValue": ""
            },
            {
              "id": "5f9456be-3ba7-43c4-bfdb-77175be84b6a",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.domain }}",
              "rightValue": "={{ $json.domain }}"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "df8c21e9-81ca-4d92-a0ab-195a3372f027",
      "name": "User has email and no organization",
      "type": "n8n-nodes-base.if",
      "position": [
        560,
        -80
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "8ceb54ef-61b0-40ed-814b-8918e34154fb",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.organization_id == null }}",
              "rightValue": ""
            },
            {
              "id": "7c0d4c59-baee-4080-9423-dfd1a9f29d82",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.active }}",
              "rightValue": ""
            },
            {
              "id": "4a45536c-5646-4e88-8498-36ad9a42efd1",
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              },
              "leftValue": "={{ $json.email }}",
              "rightValue": ""
            },
            {
              "id": "e0f5947a-9636-45c8-a73e-83adc9f66046",
              "operator": {
                "type": "string",
                "operation": "contains"
              },
              "leftValue": "={{ $json.email }}",
              "rightValue": "@"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "6f5b5cee-db76-414c-a3d6-b17f42e74a50",
      "name": "Extract Domain from User E-Mail",
      "type": "n8n-nodes-base.set",
      "position": [
        960,
        -100
      ],
      "parameters": {
        "values": {
          "number": [
            {
              "name": "user_id",
              "value": "={{ $json.id }}"
            }
          ],
          "string": [
            {
              "name": "domain",
              "value": "={{ $json.email.split('@')[1] }}"
            }
          ]
        },
        "options": {},
        "keepOnlySet": true
      },
      "typeVersion": 1,
      "alwaysOutputData": true
    },
    {
      "id": "f40e2f91-5d31-4530-98dd-9f9973549e19",
      "name": "Zammad",
      "type": "n8n-nodes-base.zammad",
      "position": [
        320,
        -80
      ],
      "parameters": {
        "filters": {},
        "operation": "getAll",
        "returnAll": true
      },
      "credentials": {
        "zammadTokenAuthApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "c336af66-f837-4ebe-9cd2-ef00dd6a3cbd",
      "name": "Zammad1",
      "type": "n8n-nodes-base.zammad",
      "position": [
        340,
        260
      ],
      "parameters": {
        "resource": "organization",
        "operation": "getAll",
        "returnAll": true
      },
      "credentials": {
        "zammadTokenAuthApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "e9389dd2-069b-48b8-8f6b-090236de67f9",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        1280,
        220
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "fieldsToMatchString": "domain"
      },
      "typeVersion": 3
    },
    {
      "id": "8bd3ae8a-401a-4f8b-8e46-16943b817969",
      "name": "Update User",
      "type": "n8n-nodes-base.zammad",
      "position": [
        1540,
        220
      ],
      "parameters": {
        "id": "={{ $json.user_id }}",
        "operation": "update",
        "updateFields": {
          "organization": "={{ $json.id }}"
        }
      },
      "credentials": {
        "zammadTokenAuthApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "41932b8d-036f-471d-b8d4-9567cf105e63",
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "Update User",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Zammad": {
      "main": [
        [
          {
            "node": "User has email and no organization",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Zammad1": {
      "main": [
        [
          {
            "node": "Organization has domain and is shared",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Domain from User E-Mail": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Test workflow\u2019": {
      "main": [
        [
          {
            "node": "Zammad",
            "type": "main",
            "index": 0
          },
          {
            "node": "Zammad1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "User has email and no organization": {
      "main": [
        [
          {
            "node": "Extract Domain from User E-Mail",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Organization has domain and is shared": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    }
  }
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

This n8n workflow automates the assignment of existing users to organizations in Zammad based on their email domains, utilizing Zammad’s "domain-based assignment" feature.

Source: https://n8n.io/workflows/2588/ — original creator credit. Request a take-down →

More General workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

General

Batch-convert CAD/BIM files to analysis-ready XLSX and optional DAE with automatic verification and a clean HTML report. Runs locally via and PowerShell on Windows.

Execute Command, Write Binary File
General

Community Node Disclaimer: This workflow uses KlickTipp community nodes.

N8N Nodes Klicktipp, Google Calendar Trigger, Google Calendar
General

Sync your Linear issues to Todoist automatically with this n8n workflow. When an issue is created, updated, or completed in Linear, a corresponding task is created, updated, or closed in Todoist. Trig

Todoist, Linear Trigger, Linear
General

Back up n8n workflows to Google Drive automatically This workflow provides a robust solution for backing up your n8n workflows to Google Drive. It is designed to handle backups for multiple n8n instan

Execute Workflow Trigger, n8n, Google Drive
General

This n8n workflow provides automated rsync backup capabilities between servers using password authentication. It automatically installs required dependencies, performs the backup operation from a sour

Execute Command