8
n8n 中文网amn8n.com

将有条件的 Adobe Commerce 客户和订单同步至 KlickTipp

中级

这是一个自动化工作流,包含 13 个节点。主要使用 Switch, Magento2, Klicktipp, ScheduleTrigger 等节点。 基于数值标签将 Adobe Commerce 客户数据同步至 KlickTipp

前置要求
  • 无特殊前置要求,导入即可使用

分类

-
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "mCtnv1ABd7XoeEJI",
  "meta": {
    "instanceId": "95b3ab5a70ab1c8c1906357a367f1b236ef12a1409406fd992f60255f0f95f85"
  },
  "name": "将有条件的标签的 Adobe Commerce 客户和订单转移到 KlickTipp",
  "tags": [
    {
      "id": "15wrq9sti6wyqr6J",
      "name": "TEMPLATE",
      "createdAt": "2025-01-08T16:34:30.163Z",
      "updatedAt": "2025-01-08T16:34:30.163Z"
    }
  ],
  "nodes": [
    {
      "id": "e569a7a0-2ce3-442f-90b1-973d03dc6d92",
      "name": "将订单数据传输到 KlickTipp",
      "type": "n8n-nodes-klicktipp.klicktipp",
      "onError": "continueErrorOutput",
      "position": [
        672,
        -32
      ],
      "parameters": {
        "email": "={{ $json.customer_email }}",
        "fields": {
          "dataFields": [
            {
              "fieldId": "fieldFirstName",
              "fieldValue": "={{ $json.customer_firstname }}"
            },
            {
              "fieldId": "fieldLastName",
              "fieldValue": "={{ $json.customer_lastname }}"
            },
            {
              "fieldId": "fieldCountry",
              "fieldValue": "={{ $json.billing_address.country_id }}"
            },
            {
              "fieldId": "fieldCity",
              "fieldValue": "={{ $json.billing_address.city }}"
            },
            {
              "fieldId": "fieldStreet1",
              "fieldValue": "={{ $json.billing_address?.street?.[0] || '' }}"
            },
            {
              "fieldId": "fieldZip",
              "fieldValue": "={{ $json.billing_address.postcode }}"
            },
            {
              "fieldId": "fieldPhone",
              "fieldValue": "={{ $json.billing_address.telephone }}"
            },
            {
              "fieldId": "field223236",
              "fieldValue": "={{ $json.payment.last_trans_id }}"
            },
            {
              "fieldId": "field223239",
              "fieldValue": "={{ $json.grand_total }}"
            },
            {
              "fieldId": "field223245",
              "fieldValue": "=https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_view-a-trans&id={{ $json.payment.last_trans_id }}"
            },
            {
              "fieldId": "field223237",
              "fieldValue": "={{ \n  ($json.items ?? [])\n    .map(i => i.name)\n    .filter(Boolean)\n    .join(', ')\n}}"
            }
          ]
        },
        "resource": "subscriber",
        "operation": "subscribe"
      },
      "credentials": {
        "klickTippApi": {
          "id": "K9JyBdCM4SZc1cXl",
          "name": "DEMO KlickTipp account"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "bdd6c077-4637-4a1b-abde-5a71f5a90eda",
      "name": "为高价值订单标记联系人",
      "type": "n8n-nodes-klicktipp.klicktipp",
      "position": [
        1312,
        -128
      ],
      "parameters": {
        "email": "={{ $json.email }}",
        "tagId": [
          "13548739"
        ],
        "resource": "contact-tagging"
      },
      "credentials": {
        "klickTippApi": {
          "id": "K9JyBdCM4SZc1cXl",
          "name": "DEMO KlickTipp account"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "aad62cd5-8160-4573-b8c3-0ade16c952a1",
      "name": "为服装购买标记联系人",
      "type": "n8n-nodes-klicktipp.klicktipp",
      "position": [
        1312,
        64
      ],
      "parameters": {
        "email": "={{ $json.email }}",
        "tagId": [
          "13548800"
        ],
        "resource": "contact-tagging"
      },
      "credentials": {
        "klickTippApi": {
          "id": "K9JyBdCM4SZc1cXl",
          "name": "DEMO KlickTipp account"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "038a339e-323d-4829-a0fc-1da5b24df7bd",
      "name": "计划触发器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        176,
        96
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "minutes"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "bdfafcfb-e780-42d0-9b84-1c6c957d8aae",
      "name": "根据 SKU 和总金额路由",
      "type": "n8n-nodes-base.switch",
      "position": [
        1008,
        -48
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "Order Value ≥ 100",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "60e8a476-a06c-4d95-9bc2-e8c621bd9a1a",
                    "operator": {
                      "type": "number",
                      "operation": "gte"
                    },
                    "leftValue": "={{ $('Get Adobe Commerce orders').item.json.grand_total }}",
                    "rightValue": 100
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Order contains clothing",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "c42480ed-b454-4604-a4d3-28c5c120497f",
                    "operator": {
                      "type": "boolean",
                      "operation": "true",
                      "singleValue": true
                    },
                    "leftValue": "={{\n  ($('Get Adobe Commerce orders').item.json.items ?? []).some(it => (it.sku ?? '') === 'TEST-002')\n}}",
                    "rightValue": "TEST-002"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {
          "allMatchingOutputs": true
        }
      },
      "typeVersion": 3.2
    },
    {
      "id": "d8262afb-d24e-484c-9132-9985fa325b75",
      "name": "获取 Adobe Commerce 订单",
      "type": "n8n-nodes-base.magento2",
      "position": [
        368,
        -32
      ],
      "parameters": {
        "options": {},
        "resource": "order",
        "operation": "getAll",
        "returnAll": true,
        "filterJson": "={\n  \"search_criteria\": {\n    \"filter_groups\": [\n      {\n        \"filters\": [\n          {\n            \"field\": \"created_at\",\n            \"condition_type\": \"gteq\",\n            \"value\":\"{{ $now.toUTC().minus({ minutes: 6 }).toFormat('yyyy-LL-dd HH:mm:ss') }}\"\n          }\n        ]\n      }\n    ],\n    \"sortOrders\": [\n      { \"field\": \"created_at\", \"direction\": \"ASC\" }\n    ]\n  }\n}",
        "filterType": "json"
      },
      "credentials": {
        "magento2Api": {
          "id": "qn3bt0IxhXE0Tx0w",
          "name": "(Mykhailo) Magento 2 account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "f499199f-ec8d-4985-a5ff-90938b02f96f",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        128,
        480
      ],
      "parameters": {
        "width": 1376,
        "height": 608,
        "content": "社区节点免责声明:此工作流使用 KlickTipp 社区节点。"
      },
      "typeVersion": 1
    },
    {
      "id": "cce7e8d3-7b57-4565-8335-70002f341046",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1232,
        -240
      ],
      "parameters": {
        "color": 7,
        "width": 272,
        "height": 696,
        "content": "## 4. 联系人标记"
      },
      "typeVersion": 1
    },
    {
      "id": "2a7aadec-0257-4fad-9e06-870eafff054f",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        912,
        -240
      ],
      "parameters": {
        "color": 7,
        "width": 304,
        "height": 696,
        "content": "## 3. 标记路由"
      },
      "typeVersion": 1
    },
    {
      "id": "6c2240fa-9841-4126-b5e0-2f9a5db40c27",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        576,
        -240
      ],
      "parameters": {
        "color": 7,
        "width": 320,
        "height": 696,
        "content": "## 2. 数据保存"
      },
      "typeVersion": 1
    },
    {
      "id": "c4dbb9ba-8709-4a0b-bc48-bf6987269464",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        128,
        -240
      ],
      "parameters": {
        "color": 7,
        "width": 428,
        "height": 696,
        "content": "## 1. 数据接收"
      },
      "typeVersion": 1
    },
    {
      "id": "b2330c7d-0210-4568-885b-abb46edc2c14",
      "name": "将客户转移到 KlickTipp",
      "type": "n8n-nodes-klicktipp.klicktipp",
      "position": [
        672,
        224
      ],
      "parameters": {
        "email": "={{ $json.email }}",
        "fields": {
          "dataFields": [
            {
              "fieldId": "fieldFirstName",
              "fieldValue": "={{ $json.firstname }}"
            },
            {
              "fieldId": "fieldLastName",
              "fieldValue": "={{ $json.lastname }}"
            },
            {
              "fieldId": "fieldCountry",
              "fieldValue": "={{ $json.addresses[0].country_id }}"
            },
            {
              "fieldId": "fieldState",
              "fieldValue": "={{ $json.addresses[0].region.region }}"
            },
            {
              "fieldId": "fieldCity",
              "fieldValue": "={{ $json.addresses[0].city }}"
            },
            {
              "fieldId": "fieldStreet1",
              "fieldValue": "={{ $json.addresses[0].street[0] }}"
            },
            {
              "fieldId": "fieldZip",
              "fieldValue": "={{ $json.addresses[0].postcode }}"
            },
            {
              "fieldId": "fieldPhone",
              "fieldValue": "={{ $json.addresses[0].telephone }}"
            }
          ]
        },
        "resource": "subscriber",
        "operation": "subscribe"
      },
      "credentials": {
        "klickTippApi": {
          "id": "K9JyBdCM4SZc1cXl",
          "name": "DEMO KlickTipp account"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "1ccf8c40-8133-4240-a38a-423ed598633c",
      "name": "获取 Adobe Commerce 客户",
      "type": "n8n-nodes-base.magento2",
      "position": [
        368,
        224
      ],
      "parameters": {
        "options": {},
        "operation": "getAll",
        "returnAll": true,
        "filterJson": "={\n  \"search_criteria\": {\n    \"filter_groups\": [\n      {\n        \"filters\": [\n          {\n            \"field\": \"updated_at\",\n            \"condition_type\": \"gteq\",\n            \"value\":\"{{ $now.toUTC().minus({ minutes: 6 }).toFormat('yyyy-LL-dd HH:mm:ss') }}\"\n          }\n        ]\n      }\n    ],\n    \"sortOrders\": [\n      { \"field\": \"updated_at\", \"direction\": \"ASC\" }\n    ]\n  }\n}",
        "filterType": "json"
      },
      "credentials": {
        "magento2Api": {
          "id": "qn3bt0IxhXE0Tx0w",
          "name": "(Mykhailo) Magento 2 account"
        }
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "1948e439-c095-4bdf-a630-d001108c5d8a",
  "connections": {
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get Adobe Commerce orders",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get Adobe Commerce customers",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Adobe Commerce orders": {
      "main": [
        [
          {
            "node": "Transfer order data to KlickTipp",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Adobe Commerce customers": {
      "main": [
        [
          {
            "node": "Transfer customers to KlickTipp",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route by SKU and total amount": {
      "main": [
        [
          {
            "node": "Tag contact for high-value order",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Tag contact for clothing purchase",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Transfer order data to KlickTipp": {
      "main": [
        [
          {
            "node": "Route by SKU and total amount",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

中级

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
中级
节点数量13
分类-
节点类型5
难度说明

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

作者
KlickTipp

KlickTipp

@KlickTipp

Reach more people. 100% GDPR compliant. Quickly create automated email campaigns, SMS and marketing automations. Market your knowledge independently of Google & Co., sell lucrative products and activate your customers.

外部链接
在 n8n.io 查看

分享此工作流