{
  "name": "Automate inventory management with Google Sheets & Gmail",
  "nodes": [
    {
      "id": "7db65121-c146-4d70-8dac-7affb58032cb",
      "name": "Send Order to Suplier",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1648,
        176
      ]
    },
    {
      "id": "0f9634e3-6688-4081-aeae-438109366bd3",
      "name": "Switch Email & PO",
      "type": "n8n-nodes-base.switch",
      "position": [
        1328,
        352
      ]
    },
    {
      "id": "5e9b4876-de98-42b5-be19-7cb8dffd5f74",
      "name": "Generate Email & PO",
      "type": "n8n-nodes-base.code",
      "position": [
        1136,
        352
      ]
    },
    {
      "id": "348e2d77-ba5e-4c48-b2b4-6a298277b29d",
      "name": "Order Handling",
      "type": "n8n-nodes-base.code",
      "position": [
        928,
        352
      ]
    },
    {
      "id": "d226a550-b568-436f-92fe-ccfc51f9d66b",
      "name": "No Operation, do nothing",
      "type": "n8n-nodes-base.noOp",
      "position": [
        2352,
        240
      ]
    },
    {
      "id": "af031a3b-8e21-44f1-887c-029a7deafcc5",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1632,
        352
      ]
    },
    {
      "id": "5242396e-9946-42a2-9f1c-446eab2e9ced",
      "name": "Trigger Everyday",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        512,
        352
      ]
    },
    {
      "id": "ba237185-bc76-4f4a-b221-d1ce16d52249",
      "name": "Get Low Stock Product",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        720,
        352
      ]
    },
    {
      "id": "510e966f-e067-414d-ad62-adff4b391e41",
      "name": "Get Purchase Order",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1888,
        368
      ]
    },
    {
      "id": "af60df87-c6c7-442b-879f-67ce6d0a07a9",
      "name": "Check Record Exists Or Not",
      "type": "n8n-nodes-base.if",
      "position": [
        2128,
        368
      ]
    },
    {
      "id": "ebf5adbf-73d5-49c6-abfb-1e074f969dce",
      "name": "Store a Purchase Order",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2368,
        464
      ]
    },
    {
      "id": "88439e45-5488-4649-a91c-34902479127d",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        656,
        176
      ],
      "parameters": {
        "width": 876,
        "height": 424,
        "content": "## Collect Low stock products\n- Code node checks product stock meets the minimum threshold or not.\n- Email created based on new stock and product details."
      }
    },
    {
      "id": "9aec0f0a-4923-4b38-8863-55b9dbdff0a7",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -112,
        224
      ],
      "parameters": {
        "width": 578,
        "height": 288,
        "content": "## How it works\nThis workflow automates inventory procurement by checking stock levels daily, calculating reorder quantities, and sending purchase orders to suppliers via email while logging them to G"
      }
    },
    {
      "id": "235522da-4a84-42b0-beb0-12d20fe147ea",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1552,
        80
      ],
      "parameters": {
        "width": 1072,
        "height": 608,
        "content": "## Data Processing\n- If already record created then skip otherwise add new record in spreadsheets."
      }
    }
  ],
  "connections": {
    "Order Handling": {
      "main": [
        [
          {
            "node": "Generate Email & PO",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Get Purchase Order",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Trigger Everyday": {
      "main": [
        [
          {
            "node": "Get Low Stock Product",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch Email & PO": {
      "main": [
        [
          {
            "node": "Send Order to Suplier",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Purchase Order": {
      "main": [
        [
          {
            "node": "Check Record Exists Or Not",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Email & PO": {
      "main": [
        [
          {
            "node": "Switch Email & PO",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Low Stock Product": {
      "main": [
        [
          {
            "node": "Order Handling",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Store a Purchase Order": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "No Operation, do nothing": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Record Exists Or Not": {
      "main": [
        [
          {
            "node": "No Operation, do nothing",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Store a Purchase Order",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}