EntraアカウントからZammadユーザーの同期

中級

これは自動化ワークフローで、14個のノードを含みます。主にIf, Set, Merge, Zammad, SplitOutなどのノードを使用。 Entra 連絡先を Zammad ユーザーに同期

前提条件
  • ターゲットAPIの認証情報が必要な場合あり

カテゴリー

-
ワークフロープレビュー
ノード接続関係を可視化、ズームとパンをサポート
ワークフローをエクスポート
以下のJSON設定をn8nにインポートして、このワークフローを使用できます
{
  "id": "ikxQzs58WxtUjbuE",
  "meta": {
    "instanceId": "494d0146a0f47676ad70a44a32086b466621f62da855e3eaf0ee51dee1f76753",
    "templateCredsSetupCompleted": true
  },
  "name": "Entra Contacts to Zammad User Sync",
  "tags": [],
  "nodes": [
    {
      "id": "5cf615cd-d555-4efa-bde4-5e1e2bda0c71",
      "name": "「Test workflow」クリック時",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -2120,
        160
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "334e380c-ce6b-48c6-be2a-e688cd52ef14",
      "name": "Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1700,
        380
      ],
      "parameters": {
        "width": 1635.910561370123,
        "height": 329.7269624573379,
        "content": "## Select Entra Contacts that should be synced to Zammad\n\n\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "39b9ace7-97ba-4202-9c7a-752f67c6a60b",
      "name": "Zammadユニバーサルユーザーオブジェクト",
      "type": "n8n-nodes-base.set",
      "position": [
        -500,
        500
      ],
      "parameters": {
        "values": {
          "number": [
            {
              "name": "entra_key",
              "value": "={{ $json.id }}"
            }
          ],
          "string": [
            {
              "name": "email",
              "value": "={{ $json.mail }}"
            },
            {
              "name": "lastname",
              "value": "={{ $json.surname }}"
            },
            {
              "name": "firstname",
              "value": "={{ $json.givenName }}"
            },
            {
              "name": "mobile",
              "value": "={{ $json.phones[1].number }}"
            },
            {
              "name": "phone",
              "value": "={{ $json.phones[2].number }}"
            }
          ]
        },
        "options": {},
        "keepOnlySet": true
      },
      "typeVersion": 1
    },
    {
      "id": "df5b4173-e1bd-49ce-9827-1b51a5e98da0",
      "name": "Zammadユーザーを取得",
      "type": "n8n-nodes-base.zammad",
      "position": [
        -1000,
        160
      ],
      "parameters": {
        "filters": {},
        "operation": "getAll",
        "returnAll": true
      },
      "credentials": {
        "zammadTokenAuthApi": {
          "id": "fj5GuzcJuNLQeMxz",
          "name": "Zammad Token Auth account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "7f1d3b74-48dd-4245-9f17-286bcc552047",
      "name": "マージ",
      "type": "n8n-nodes-base.merge",
      "position": [
        200,
        180
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "fieldsToMatchString": "email"
      },
      "typeVersion": 3
    },
    {
      "id": "c98c849e-8b0c-45b0-9b05-6b648bf9329c",
      "name": "新しいZammadユーザーを検出",
      "type": "n8n-nodes-base.compareDatasets",
      "position": [
        200,
        460
      ],
      "parameters": {
        "options": {},
        "mergeByFields": {
          "values": [
            {
              "field1": "email",
              "field2": "email"
            }
          ]
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "079437ca-a379-48ba-a4e5-52b87454adba",
      "name": "Zammadユーザーを更新",
      "type": "n8n-nodes-base.zammad",
      "position": [
        560,
        180
      ],
      "parameters": {
        "id": "={{ $json.id }}",
        "operation": "update",
        "updateFields": {
          "phone": "={{ $json.phone }}",
          "mobile": "={{ $json.mobile }}",
          "lastname": "={{ $json.lastname }}",
          "firstname": "={{ $json.firstname }}",
          "customFieldsUi": {
            "customFieldPairs": [
              {
                "name": "entra_key",
                "value": "={{ $json.entra_key }}"
              },
              {
                "name": "entra_object_type",
                "value": "contact"
              }
            ]
          }
        }
      },
      "credentials": {
        "zammadTokenAuthApi": {
          "id": "fj5GuzcJuNLQeMxz",
          "name": "Zammad Token Auth account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "34140616-c9c2-4899-a6a8-dc6e89a87c5c",
      "name": "Zammadユーザーを作成",
      "type": "n8n-nodes-base.zammad",
      "position": [
        580,
        480
      ],
      "parameters": {
        "lastname": "={{ $json.lastname }}",
        "firstname": "={{ $json.firstname }}",
        "additionalFields": {
          "email": "={{ $json.email }}",
          "phone": "={{ $json.phone }}",
          "mobile": "={{ $json.mobile }}",
          "customFieldsUi": {
            "customFieldPairs": [
              {
                "name": "entra_key",
                "value": "={{ $json.entra_key }}"
              },
              {
                "name": "entra_object_type",
                "value": "contact"
              }
            ]
          }
        }
      },
      "credentials": {
        "zammadTokenAuthApi": {
          "id": "fj5GuzcJuNLQeMxz",
          "name": "Zammad Token Auth account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "6c8ef4d9-7bb2-4090-a0cf-411269f766aa",
      "name": "Zammadユーザーを無効化",
      "type": "n8n-nodes-base.zammad",
      "position": [
        600,
        860
      ],
      "parameters": {
        "id": "={{ $json.id }}",
        "operation": "update",
        "updateFields": {
          "phone": "={{ $json.phone }}",
          "active": false,
          "mobile": "={{ $json.mobile }}",
          "lastname": "={{ $json.lastname }}",
          "firstname": "={{ $json.firstname }}",
          "customFieldsUi": {
            "customFieldPairs": [
              {
                "name": "entra_key",
                "value": "={{ $json.entra_key }}"
              },
              {
                "name": "entra_object_type",
                "value": "contact"
              }
            ]
          }
        }
      },
      "credentials": {
        "zammadTokenAuthApi": {
          "id": "fj5GuzcJuNLQeMxz",
          "name": "Zammad Token Auth account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "e3db9840-666a-42d3-9466-70e970a57f29",
      "name": "削除済みユーザーを検出",
      "type": "n8n-nodes-base.compareDatasets",
      "position": [
        200,
        880
      ],
      "parameters": {
        "options": {},
        "resolve": "preferInput1",
        "mergeByFields": {
          "values": [
            {
              "field1": "entra_key",
              "field2": "entra_key"
            }
          ]
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "6100fd80-8d9c-44ed-bfc1-6d39794c5405",
      "name": "Entraから連絡先を取得",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1600,
        500
      ],
      "parameters": {
        "url": "https://graph.microsoft.com/v1.0/contacts",
        "options": {},
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "microsoftOAuth2Api"
      },
      "credentials": {
        "microsoftOAuth2Api": {
          "id": "U2E5p3lreqSi8v1N",
          "name": "ms365test.zammad.org"
        },
        "microsoftGraphSecurityOAuth2Api": {
          "id": "b09tqOxzkl0P8UQD",
          "name": "ms365test.zammad.org"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "27e598a5-39a5-408b-a8ab-bf0ada9a6870",
      "name": "Entra連絡先",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        -1220,
        500
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "value"
      },
      "typeVersion": 1
    },
    {
      "id": "ac38d73e-7a71-4b7d-913e-abc96236b124",
      "name": "必要に応じて連絡先をフィルター",
      "type": "n8n-nodes-base.if",
      "position": [
        -840,
        500
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "15da9b4f-46fa-4e9b-bd33-40ae79b88cd5",
              "operator": {
                "type": "object",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "28d3faf9-7cf4-4470-941b-abada3de3b9c",
      "name": "必要に応じてフィルター",
      "type": "n8n-nodes-base.if",
      "position": [
        -400,
        160
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "5b258616-66b2-4378-8215-5dce8edd19b3",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.entra_object_type }}",
              "rightValue": "contact"
            },
            {
              "id": "0d569bde-d384-48d0-a208-aa707752d6e5",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.active }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "55f3ac0f-d15e-4643-a1ca-26f4ade7bb14",
  "connections": {
    "7f1d3b74-48dd-4245-9f17-286bcc552047": {
      "main": [
        [
          {
            "node": "079437ca-a379-48ba-a4e5-52b87454adba",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "27e598a5-39a5-408b-a8ab-bf0ada9a6870": {
      "main": [
        [
          {
            "node": "ac38d73e-7a71-4b7d-913e-abc96236b124",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "28d3faf9-7cf4-4470-941b-abada3de3b9c": {
      "main": [
        [
          {
            "node": "7f1d3b74-48dd-4245-9f17-286bcc552047",
            "type": "main",
            "index": 0
          },
          {
            "node": "c98c849e-8b0c-45b0-9b05-6b648bf9329c",
            "type": "main",
            "index": 0
          },
          {
            "node": "e3db9840-666a-42d3-9466-70e970a57f29",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "df5b4173-e1bd-49ce-9827-1b51a5e98da0": {
      "main": [
        [
          {
            "node": "28d3faf9-7cf4-4470-941b-abada3de3b9c",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "e3db9840-666a-42d3-9466-70e970a57f29": {
      "main": [
        [
          {
            "node": "6c8ef4d9-7bb2-4090-a0cf-411269f766aa",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "c98c849e-8b0c-45b0-9b05-6b648bf9329c": {
      "main": [
        [],
        [],
        [],
        [
          {
            "node": "34140616-c9c2-4899-a6a8-dc6e89a87c5c",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "6100fd80-8d9c-44ed-bfc1-6d39794c5405": {
      "main": [
        [
          {
            "node": "27e598a5-39a5-408b-a8ab-bf0ada9a6870",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ac38d73e-7a71-4b7d-913e-abc96236b124": {
      "main": [
        [
          {
            "node": "39b9ace7-97ba-4202-9c7a-752f67c6a60b",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "39b9ace7-97ba-4202-9c7a-752f67c6a60b": {
      "main": [
        [
          {
            "node": "7f1d3b74-48dd-4245-9f17-286bcc552047",
            "type": "main",
            "index": 1
          },
          {
            "node": "c98c849e-8b0c-45b0-9b05-6b648bf9329c",
            "type": "main",
            "index": 1
          },
          {
            "node": "e3db9840-666a-42d3-9466-70e970a57f29",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "5cf615cd-d555-4efa-bde4-5e1e2bda0c71": {
      "main": [
        [
          {
            "node": "df5b4173-e1bd-49ce-9827-1b51a5e98da0",
            "type": "main",
            "index": 0
          },
          {
            "node": "6100fd80-8d9c-44ed-bfc1-6d39794c5405",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
よくある質問

このワークフローの使い方は?

上記のJSON設定コードをコピーし、n8nインスタンスで新しいワークフローを作成して「JSONからインポート」を選択、設定を貼り付けて認証情報を必要に応じて変更してください。

このワークフローはどんな場面に適していますか?

中級

有料ですか?

このワークフローは完全無料です。ただし、ワークフローで使用するサードパーティサービス(OpenAI APIなど)は別途料金が発生する場合があります。

ワークフロー情報
難易度
中級
ノード数14
カテゴリー-
ノードタイプ9
難易度説明

経験者向け、6-15ノードの中程度の複雑さのワークフロー

作成者
Sirhexalot

Sirhexalot

@sirhexalot

Open source enthusiast and Zammad user with a passion for sharing knowledge and building simple, effective automation solutions with n8n.

外部リンク
n8n.ioで表示

このワークフローを共有

カテゴリー

カテゴリー: 34