{
  "name": "Sync new Shopify orders to Google Sheets with GPT-4.1-mini analysis",
  "nodes": [
    {
      "id": "4c43c050-482d-4594-a5a0-405c40063680",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        256,
        -112
      ]
    },
    {
      "id": "900c409e-6239-4bf3-9e48-8458e6375332",
      "name": "Run Workflow Every Few Minutes",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -960,
        -224
      ]
    },
    {
      "id": "b1aa6465-64c1-4139-bb24-26b03a08dc10",
      "name": "Get Last Successful Sync Time",
      "type": "n8n-nodes-base.code",
      "position": [
        -704,
        -224
      ]
    },
    {
      "id": "6480be0d-ec9c-42d0-946f-9db40078c7c4",
      "name": "Fetch Orders from Shopify",
      "type": "n8n-nodes-base.shopify",
      "position": [
        -480,
        -224
      ]
    },
    {
      "id": "d6427105-9c4e-4594-8484-c8052505f1d5",
      "name": "Mark Orders as New or Old",
      "type": "n8n-nodes-base.code",
      "position": [
        -256,
        -224
      ]
    },
    {
      "id": "02c2ad8f-d05a-4d90-9389-8bd3d8a924b2",
      "name": "Is This a New Order?",
      "type": "n8n-nodes-base.if",
      "position": [
        -64,
        -224
      ]
    },
    {
      "id": "f167cc80-ca9b-457e-bfae-00e3cdff174d",
      "name": "AI Order Analysis",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        256,
        -368
      ]
    },
    {
      "id": "e28db2e1-e15a-4e27-9a0b-03f62eb62997",
      "name": "Prepare Final Order Data",
      "type": "n8n-nodes-base.set",
      "position": [
        800,
        -368
      ]
    },
    {
      "id": "9bd7464b-df2e-4e13-a47e-c001ba1634ee",
      "name": "Convert AI Response to Data",
      "type": "n8n-nodes-base.code",
      "position": [
        576,
        -368
      ]
    },
    {
      "id": "d1674778-2940-416e-99f7-566bf6d44a98",
      "name": "Save Order to Google Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1024,
        -368
      ]
    },
    {
      "id": "857dd76a-f0c2-4ba8-9387-0cfe5d880b75",
      "name": "Update Sync Time",
      "type": "n8n-nodes-base.code",
      "position": [
        1232,
        -368
      ]
    },
    {
      "id": "939ebcf3-a00a-4a7c-9015-327db5e5336b",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1040,
        -352
      ],
      "parameters": {
        "width": null,
        "height": 288,
        "content": "This node starts the workflow automatically every few minutes.\nIt checks Shopify regularly for new orders without manual effort."
      }
    },
    {
      "id": "b6944e38-6b02-43c9-a69a-02525f6dd3e9",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -784,
        -352
      ],
      "parameters": {
        "width": null,
        "height": 288,
        "content": "This node remembers the last time orders were successfully synced.\nIt helps avoid fetching the same order again and again."
      }
    },
    {
      "id": "54fddf9b-d7a6-4066-af06-87dd593ce5e8",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -528,
        -464
      ],
      "parameters": {
        "width": 624,
        "height": 432,
        "content": "## New Order Detection Process\n\nThis section detects only new Shopify orders.\nOrders are fetched based on the last successful sync time.\nEach order’s creation time is compared with the stored sync val"
      }
    },
    {
      "id": "d6e47373-e768-4736-8978-24b3f5e99b45",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        112,
        -576
      ],
      "parameters": {
        "width": 1312,
        "height": 592,
        "content": "## Order Processing & Storage\nOnce a new order is detected, this part of the workflow takes over.\nThe AI reviews the order to understand its importance and category.\nThe order data is then cleaned, or"
      }
    },
    {
      "id": "2755d6f0-8610-41d1-96e0-e6abf7b905d7",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1728,
        -976
      ],
      "parameters": {
        "width": 480,
        "height": 752,
        "content": "## How it works \n\nThis workflow automatically checks Shopify for new orders at regular intervals.\nIt remembers the last time it successfully ran and only looks for orders created after that time, so t"
      }
    }
  ],
  "connections": {
    "Update Sync Time": {
      "main": [
        []
      ]
    },
    "AI Order Analysis": {
      "main": [
        [
          {
            "node": "Convert AI Response to Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Order Analysis",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Is This a New Order?": {
      "main": [
        [
          {
            "node": "AI Order Analysis",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Final Order Data": {
      "main": [
        [
          {
            "node": "Save Order to Google Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Orders from Shopify": {
      "main": [
        [
          {
            "node": "Mark Orders as New or Old",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mark Orders as New or Old": {
      "main": [
        [
          {
            "node": "Is This a New Order?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Order to Google Sheet": {
      "main": [
        [
          {
            "node": "Update Sync Time",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert AI Response to Data": {
      "main": [
        [
          {
            "node": "Prepare Final Order Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Last Successful Sync Time": {
      "main": [
        [
          {
            "node": "Fetch Orders from Shopify",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run Workflow Every Few Minutes": {
      "main": [
        [
          {
            "node": "Get Last Successful Sync Time",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}