Zammad - 使用基于域名的分配为现有用户分配组织
中级
这是一个Support领域的自动化工作流,包含 8 个节点。主要使用 If, Set, Merge, Zammad, ManualTrigger 等节点。 根据邮箱域名将Zammad用户分配到组织
前置要求
- •无特殊前置要求,导入即可使用
使用的节点 (8)
分类
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
"id": "QXhjTKmtXQyDDsAf",
"meta": {
"instanceId": "494d0146a0f47676ad70a44a32086b466621f62da855e3eaf0ee51dee1f76753",
"templateCredsSetupCompleted": true
},
"name": "Zammad - 使用\"基于域名的分配\"为现有用户分配组织",
"tags": [],
"nodes": [
{
"id": "d62c20b0-332a-4c7d-96cb-c19fe03bf151",
"name": "当点击\"测试工作流\"时",
"type": "n8n-nodes-base.manualTrigger",
"position": [
40,
-80
],
"parameters": {},
"typeVersion": 1
},
{
"id": "9c23b715-1e88-4b3a-9146-377c9e0fc980",
"name": "组织拥有域名且为共享状态",
"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": "用户拥有电子邮件但无组织",
"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": "从用户电子邮件中提取域名",
"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": {
"id": "fj5GuzcJuNLQeMxz",
"name": "Zammad Token Auth account"
}
},
"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": {
"id": "fj5GuzcJuNLQeMxz",
"name": "Zammad Token Auth account"
}
},
"typeVersion": 1
},
{
"id": "e9389dd2-069b-48b8-8f6b-090236de67f9",
"name": "合并",
"type": "n8n-nodes-base.merge",
"position": [
1280,
220
],
"parameters": {
"mode": "combine",
"options": {},
"fieldsToMatchString": "domain"
},
"typeVersion": 3
},
{
"id": "8bd3ae8a-401a-4f8b-8e46-16943b817969",
"name": "更新用户",
"type": "n8n-nodes-base.zammad",
"position": [
1540,
220
],
"parameters": {
"id": "={{ $json.user_id }}",
"operation": "update",
"updateFields": {
"organization": "={{ $json.id }}"
}
},
"credentials": {
"zammadTokenAuthApi": {
"id": "fj5GuzcJuNLQeMxz",
"name": "Zammad Token Auth account"
}
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"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 ‘Test workflow’": {
"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
}
]
]
}
}
}常见问题
如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
中级 - 客户支持
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
Entra 用户到 Zammad 用户同步
将 Entra 用户同步至 Zammad 用户
If
Set
Merge
+6
15 节点Sirhexalot
客户支持
将Zammad对象用户、角色、组和组织导出到Excel
将Zammad对象(用户、角色、组、组织)导出到Excel
If
Set
Zammad
+3
18 节点Sirhexalot
客户支持
将所有 Zammad 角色更新为默认值
将所有 Zammad 角色更新为默认值
If
Set
Zammad
+3
10 节点Sirhexalot
客户支持
Entra联系人到Zammad用户同步
Entra联系人到Zammad用户同步
If
Set
Merge
+6
14 节点Sirhexalot
通过 Excel 更新角色
通过 Excel 更新 Zammad 角色
Set
Merge
Http Request
+3
9 节点Sirhexalot
客户支持
使用Have I Been Pwned实时监控数据泄露
使用Have I Been Pwned实时监控数据泄露
If
Set
Merge
+9
24 节点Audun
客户支持
工作流信息
难度等级
中级
节点数量8
分类1
节点类型5
作者
Sirhexalot
@sirhexalotOpen source enthusiast and Zammad user with a passion for sharing knowledge and building simple, effective automation solutions with n8n.
外部链接
在 n8n.io 查看 →
分享此工作流