{
  "nodes": [
    {
      "id": "1b1fd43f-5acb-45e7-bd98-e4774754cdfe",
      "name": "On order updated",
      "type": "n8n-nodes-base.shopifyTrigger",
      "position": [
        180,
        520
      ],
      "parameters": {
        "topic": "orders/updated"
      },
      "typeVersion": 1
    },
    {
      "id": "d96cde15-f810-4302-aa45-554f6675b505",
      "name": "Order exists in Zendesk",
      "type": "n8n-nodes-base.if",
      "position": [
        1220,
        540
      ],
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{ $json[\"ZendeskTicketId\"] }}",
              "operation": "isNotEmpty"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "62c09ef2-55c8-4269-9869-c15e8a955169",
      "name": "NoOp",
      "type": "n8n-nodes-base.noOp",
      "position": [
        1500,
        460
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "68f867c3-842c-478a-8afd-c7299e12b98d",
      "name": "Find if order already has a ticket in Zendesk",
      "type": "n8n-nodes-base.zendesk",
      "position": [
        480,
        660
      ],
      "parameters": {
        "options": {
          "query": "external_id:1027",
          "status": "open"
        },
        "operation": "getAll"
      },
      "typeVersion": 1,
      "alwaysOutputData": true
    },
    {
      "id": "01d4acba-8641-43e8-b333-e4494a2594d1",
      "name": "Keep only ticket Id",
      "type": "n8n-nodes-base.set",
      "position": [
        720,
        660
      ],
      "parameters": {
        "values": {
          "string": [
            {
              "name": "external_Id",
              "value": "={{ $json[\"external_id\"] }}"
            },
            {
              "name": "ZendeskTicketId",
              "value": "={{ $json[\"id\"] }}"
            }
          ]
        },
        "options": {},
        "keepOnlySet": true
      },
      "typeVersion": 1
    },
    {
      "id": "63099ec6-7ae5-4d88-881b-a6a8ae3a64b8",
      "name": "Add ticket info to order data",
      "type": "n8n-nodes-base.merge",
      "position": [
        960,
        540
      ],
      "parameters": {
        "mode": "mergeByKey",
        "propertyName1": "order_number",
        "propertyName2": "external_Id"
      },
      "typeVersion": 1
    },
    {
      "id": "79bf059e-d3b9-4323-88e5-7887deae74f7",
      "name": "Create new ticket for new orders",
      "type": "n8n-nodes-base.zendesk",
      "position": [
        1500,
        640
      ],
      "parameters": {
        "description": "=Order #{{ $json[\"order_number\"] }} - {{$json[\"line_items\"].length}} item(s)\n\nOrder:\nCustomer: {{$json[\"customer\"][\"first_name\"]}} {{$json[\"customer\"][\"last_name\"]}} \nemail: {{$json[\"customer\"][\"email\"]}}\nStatus: New order",
        "additionalFields": {
          "status": "open",
          "subject": "=Order #{{ $json[\"order_number\"] }} - {{$json[\"line_items\"].length}} item(s)",
          "externalId": "={{ $json[\"order_number\"] }}"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "2260c37f-ad00-5d2c-b5f0-d8f89f6a4d49",
      "name": "Publication · Overview and setup",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -800,
        0
      ],
      "parameters": {
        "content": "# receive shopify events and list zendesk and create new ticket for new orders\n\n## Purpose and structure\nThis folder contains the **receive shopify events and list zendesk and create new ticket for new orders** workflow. Its executable nodes use `if`, `merge`, `noOp`, `set`, `shopifyTrigger`, `zendesk`. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.\n\n## Setup\nImport inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.\n\n## Entry points\nOn order updated\n\n## Verification\nSanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.\n\n## Attribution\nhttps://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Shopify/0269_Shopify_Zendesk_Create_Triggered.json\nMIT; preserve source notices.",
        "width": 700,
        "height": 800,
        "color": 1
      }
    }
  ],
  "connections": {
    "On order updated": {
      "main": [
        [
          {
            "node": "Find if order already has a ticket in Zendesk",
            "type": "main",
            "index": 0
          },
          {
            "node": "Add ticket info to order data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Keep only ticket Id": {
      "main": [
        [
          {
            "node": "Add ticket info to order data",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Order exists in Zendesk": {
      "main": [
        [
          {
            "node": "NoOp",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Create new ticket for new orders",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add ticket info to order data": {
      "main": [
        [
          {
            "node": "Order exists in Zendesk",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Find if order already has a ticket in Zendesk": {
      "main": [
        [
          {
            "node": "Keep only ticket Id",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false
}
