{
  "name": "Lesson 3",
  "nodes": [
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "1c2013cb-b7dd-40f2-8054-eabe3db45706",
              "leftValue": "={{$json[\"amount\"]}}",
              "rightValue": 200,
              "operator": {
                "type": "number",
                "operation": "gt"
              }
            },
            {
              "id": "ee41c2e6-58cc-4df0-95df-1ed1489dbebf",
              "leftValue": "",
              "rightValue": "",
              "operator": {
                "type": "string",
                "operation": "equals",
                "name": "filter.operator.equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        -112,
        608
      ],
      "id": "4da1b165-a92d-4904-892f-0027d230378d",
      "name": "If"
    },
    {
      "parameters": {
        "batchSize": 2,
        "options": {}
      },
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 3,
      "position": [
        -64,
        208
      ],
      "id": "c6ef9fed-af90-4dbc-8f31-fc65a847ac7f",
      "name": "Loop Over Items"
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "leftValue": "={{$json[\"priority\"]}}",
                    "rightValue": "high",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "id": "2bd60177-aec1-4ac7-a1e4-ea81356854bd"
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "high"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "ee4f3149-dfa5-4f69-b3e7-2638024c4053",
                    "leftValue": "={{$json[\"priority\"]}}",
                    "rightValue": "medium",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "medium"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "a985386c-8702-44a5-bd79-9cdcf49cd52d",
                    "leftValue": "={{$json[\"priority\"]}}",
                    "rightValue": "low",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "low"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.3,
      "position": [
        -48,
        -112
      ],
      "id": "66ba3edd-ec77-40f7-bb4a-f19fa894d8a3",
      "name": "Switch"
    },
    {
      "parameters": {},
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        -576,
        208
      ],
      "id": "c65b49a8-44d1-4c5e-bcd2-b617edf24733",
      "name": "When clicking ‘Execute workflow’"
    },
    {
      "parameters": {
        "jsCode": "// Список заказов с разным приоритетом, статусом и суммой\nreturn [\n  {\n    json: {\n      id: 1,\n      customer: \"Nikita\",\n      priority: \"high\",\n      status: \"new\",\n      amount: 500\n    }\n  },\n  {\n    json: {\n      id: 2,\n      customer: \"Maria\",\n      priority: \"medium\",\n      status: \"paid\",\n      amount: 150\n    }\n  },\n  {\n    json: {\n      id: 3,\n      customer: \"John\",\n      priority: \"low\",\n      status: \"canceled\",\n      amount: 50\n    }\n  },\n  {\n    json: {\n      id: 4,\n      customer: \"Anna\",\n      priority: \"high\",\n      status: \"paid\",\n      amount: 900\n    }\n  },\n  {\n    json: {\n      id: 5,\n      customer: \"Karl\",\n      priority: \"medium\",\n      status: \"new\",\n      amount: 60\n    }\n  }\n];\n"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -352,
        208
      ],
      "id": "8560b62c-f6d4-4f54-9ae4-bfc860e83fee",
      "name": "Стартовые данные"
    },
    {
      "parameters": {
        "jsCode": "// Помечаем все элементы в текущем батче как обработанные\nreturn items.map(item => {\n  item.json.processed = true;\n  return item;\n});\n"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        144,
        304
      ],
      "id": "67de88d3-01a8-4946-9eb8-9c3a887c25ae",
      "name": "Process Batch"
    },
    {
      "parameters": {},
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        320,
        80
      ],
      "id": "d878c9b4-bb0a-411c-8225-71b3ce0b47a3",
      "name": "No Operation, do nothing"
    },
    {
      "parameters": {
        "amount": 3
      },
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        -112,
        800
      ],
      "id": "2b920806-6b09-4a24-b217-1821313b39fd",
      "name": "Wait",
      "webhookId": "ab6cc69c-9c36-439c-84f7-d9f8f463a0d0"
    },
    {
      "parameters": {
        "amount": 3
      },
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        384,
        384
      ],
      "id": "a5ae8cb7-449e-44f4-a194-00a522879fe7",
      "name": "Wait1",
      "webhookId": "2741630c-ae5b-40c3-afa7-4977d5150e82"
    },
    {
      "parameters": {
        "content": "## Привет от Yefimov_AI\n\nНе забудь подписаться на Youtube и телеграм канал"
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -1376,
        3024
      ],
      "id": "62340faf-828d-44be-ba6a-671c53e870e9",
      "name": "Sticky Note3"
    }
  ],
  "pinData": {},
  "connections": {
    "Loop Over Items": {
      "main": [
        [
          {
            "node": "No Operation, do nothing",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Process Batch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Стартовые данные",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Стартовые данные": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          },
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          },
          {
            "node": "If",
            "type": "main",
            "index": 0
          },
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process Batch": {
      "main": [
        [
          {
            "node": "Wait1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait1": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "529b348a-0c88-4c7d-811d-9d75c6747f2f",
  "meta": {
    "instanceId": "7ef81a965bb52d3c42bd218dc22fb53205bba7e12a5fda73cdb321bee53a0ffc"
  },
  "id": "z3c1d69gGynGSRnk",
  "tags": [
    {
      "updatedAt": "2025-07-26T19:24:38.741Z",
      "createdAt": "2025-07-26T19:24:38.741Z",
      "id": "PhEU8XvMbDgCJtf7",
      "name": "yefimov_ai"
    }
  ]
}