8
n8n 中文网amn8n.com

Shopify产品(按游标)

初级

这是一个Engineering领域的自动化工作流,包含 5 个节点。主要使用 If, Wait, Graphql, ManualTrigger 等节点。 基于GraphQL游标导航的Shopify产品分页

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

分类

工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "1VFYPRbT3Rm0LI8B",
  "meta": {
    "instanceId": "eeebdb47cbe0bf5bc137514a863458fd2f9ab992b2ebeb2c6062100cdade81e7",
    "templateCredsSetupCompleted": true
  },
  "name": "Shopify 产品(按游标)",
  "tags": [],
  "nodes": [
    {
      "id": "6afbcef7-96c0-46de-915f-e186c74c6d65",
      "name": "启动工作流",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        0,
        -120
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "f845ead7-cf3d-4ab8-94ba-075763600875",
      "name": "Shopify, 产品",
      "type": "n8n-nodes-base.graphql",
      "position": [
        220,
        -120
      ],
      "parameters": {
        "query": "query ($pageSize: Int!, $cursor: String) {\n    products(first: $pageSize, after: $cursor) {\n        edges {\n            node {\n                id\n                title\n                handle\n                createdAt\n                updatedAt\n            }\n        }\n        pageInfo {\n            hasNextPage\n            endCursor\n        }\n    }\n}",
        "endpoint": "https://store99563.myshopify.com/admin/api/2025-04/graphql.json",
        "variables": "={\n    \"pageSize\": 5,\n    \"cursor\": {{ $if($json?.data?.products?.pageInfo?.hasNextPage !== undefined, \"\\\"\" + $json.data.products.pageInfo.endCursor + \"\\\"\", \"null\"); }}\n}",
        "authentication": "headerAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "mHtpN3u5aCWsxWih",
          "name": "Shopify GraphQL Header Auth account"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "67c4c2ff-e653-438c-8200-909ee0ad1dd4",
      "name": "hasMoreProducts",
      "type": "n8n-nodes-base.if",
      "position": [
        440,
        -120
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "a31f61a1-242c-418b-8e5a-ad878a439246",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.data.products.pageInfo.hasNextPage }}",
              "rightValue": "true"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "d3fef035-b854-49ac-ba22-7ed66444dda3",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -40,
        -360
      ],
      "parameters": {
        "width": 780,
        "height": 220,
        "content": "## Shopify GraphQL 游标循环"
      },
      "typeVersion": 1
    },
    {
      "id": "6bcd2224-c82b-4b3e-a0e0-773a4fffc166",
      "name": "等待 1 秒",
      "type": "n8n-nodes-base.wait",
      "position": [
        660,
        0
      ],
      "webhookId": "d114eefe-36b8-49cf-bba8-596928fdfc67",
      "parameters": {
        "amount": 1
      },
      "typeVersion": 1.1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "5734f646-93c7-41bf-ba1f-3ebc95cacf9b",
  "connections": {
    "Wait 1s": {
      "main": [
        [
          {
            "node": "Shopify, products",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Start Workflow": {
      "main": [
        [
          {
            "node": "Shopify, products",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "hasMoreProducts": {
      "main": [
        [
          {
            "node": "Wait 1s",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Shopify, products": {
      "main": [
        [
          {
            "node": "hasMoreProducts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

初级 - 工程

需要付费吗?

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

工作流信息
难度等级
初级
节点数量5
分类1
节点类型5
难度说明

适合 n8n 新手,包含 1-5 个节点的简单工作流

外部链接
在 n8n.io 查看

分享此工作流