{
  "name": "Raw materials inventory management with Google Sheets, Supabase and approvals",
  "nodes": [
    {
      "id": "c983fae5-a779-4a56-ace0-304aaefe0433",
      "name": "Append Material Request",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        6780,
        3240
      ]
    },
    {
      "id": "25d745c1-8167-4c55-9f88-461f94843286",
      "name": "Get Approvals",
      "type": "n8n-nodes-base.webhook",
      "position": [
        5900,
        4060
      ]
    },
    {
      "id": "c4d96a9c-b70b-4e40-bf9d-5e8f9426ee22",
      "name": "Standardize Data",
      "type": "n8n-nodes-base.set",
      "position": [
        6120,
        3400
      ]
    },
    {
      "id": "47d2bb01-99e6-4ab1-b19d-bc9912243150",
      "name": "Update Stock",
      "type": "n8n-nodes-base.code",
      "position": [
        7440,
        3860
      ]
    },
    {
      "id": "dcbb196f-1ecf-4137-af29-e511c4b7b9d9",
      "name": "Receive Issue Request",
      "type": "n8n-nodes-base.webhook",
      "position": [
        5900,
        3400
      ]
    },
    {
      "id": "430599b6-3758-4eb7-a924-8530a7c5dc7e",
      "name": "Send Approval Request",
      "type": "n8n-nodes-base.gmail",
      "position": [
        7660,
        3400
      ]
    },
    {
      "id": "7c68ef5d-5518-4236-803c-157fe8c581dd",
      "name": "Prepare Approval",
      "type": "n8n-nodes-base.code",
      "position": [
        7440,
        3400
      ]
    },
    {
      "id": "bf6487d1-dd4e-4bc1-9447-c3aaeffd5df0",
      "name": "Create Record Issue",
      "type": "n8n-nodes-base.supabase",
      "position": [
        6780,
        3560
      ]
    },
    {
      "id": "86899f38-6412-447f-9b6d-a402f6c39fcd",
      "name": "Search Product ID",
      "type": "n8n-nodes-base.supabase",
      "position": [
        7000,
        3560
      ]
    },
    {
      "id": "6bb9053b-9a46-4e9e-9097-d5e2ae99e259",
      "name": "Searck Issues",
      "type": "n8n-nodes-base.supabase",
      "position": [
        6560,
        4220
      ]
    },
    {
      "id": "420d242b-6a17-4538-bca1-09283a49742f",
      "name": "Update Current Stck",
      "type": "n8n-nodes-base.supabase",
      "position": [
        7680,
        3740
      ]
    },
    {
      "id": "f4c8cb13-acd9-4d7e-ac73-fb528c1700e1",
      "name": "Merge Lookups",
      "type": "n8n-nodes-base.merge",
      "position": [
        7220,
        3400
      ]
    },
    {
      "id": "0cc01e7c-aa88-4783-af20-5b98f8795935",
      "name": "Update Current Stock1",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        7660,
        3960
      ]
    },
    {
      "id": "67cf6b2c-7166-4075-904b-67c82d94df70",
      "name": "LookUp Current stock1",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        7880,
        3960
      ]
    },
    {
      "id": "bb65a800-e307-46a9-a668-b3e7afa32792",
      "name": "Low stock Detection1",
      "type": "n8n-nodes-base.code",
      "position": [
        8100,
        3960
      ]
    },
    {
      "id": "02bd1da9-ecdf-4d05-aa1f-9974f00849b7",
      "name": "Merge1",
      "type": "n8n-nodes-base.merge",
      "position": [
        6780,
        4060
      ]
    },
    {
      "id": "1e06a4e7-243a-40cd-8aef-1a06a373778a",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5840,
        3060
      ],
      "parameters": {
        "width": 2820,
        "height": 1400,
        "content": "# Material Issue Request and Approval"
      }
    },
    {
      "id": "ee7270e1-83ff-4d91-8ba8-db4f13c63a57",
      "name": "Append Raw Materials",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        6660,
        1820
      ]
    },
    {
      "id": "21c17077-9f9a-489a-b6a5-ea7a70a85cee",
      "name": "Calculate Total Price",
      "type": "n8n-nodes-base.code",
      "position": [
        6340,
        2040
      ]
    },
    {
      "id": "4ce817b0-2283-438f-82c7-6f4901fffdd3",
      "name": "Calculate Updated Current Stock",
      "type": "n8n-nodes-base.code",
      "position": [
        7640,
        1840
      ]
    },
    {
      "id": "79fa9b6a-45c7-43bd-b5ba-bc2526a87d1e",
      "name": "Validate Quantity Received",
      "type": "n8n-nodes-base.code",
      "position": [
        6840,
        1820
      ]
    },
    {
      "id": "298cee40-074c-4888-af10-05b0be136a75",
      "name": "Initialize New Product stock",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        7860,
        2200
      ]
    },
    {
      "id": "4f102052-db49-4767-b856-41d5e4a6cf33",
      "name": "Update Current Stock",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        7860,
        1940
      ]
    },
    {
      "id": "33d107ac-960e-44aa-b643-993ef4973beb",
      "name": "LookUp Current stock",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        8080,
        1940
      ]
    },
    {
      "id": "e0c03d90-f580-43f4-b794-2d278d123b08",
      "name": "New Row Current Stock",
      "type": "n8n-nodes-base.supabase",
      "position": [
        7860,
        2520
      ]
    },
    {
      "id": "f9e1fae8-ce0a-4ab7-9dbb-f2eaccdf0ac9",
      "name": "Current Stock Update",
      "type": "n8n-nodes-base.supabase",
      "position": [
        7860,
        1720
      ]
    },
    {
      "id": "ef8ac9f6-a26e-4e74-b0f6-59066991a343",
      "name": "Search Current Stock",
      "type": "n8n-nodes-base.supabase",
      "position": [
        6960,
        2260
      ]
    },
    {
      "id": "3e519621-e955-4033-8197-249c5e153dea",
      "name": "Format response",
      "type": "n8n-nodes-base.itemLists",
      "position": [
        7620,
        2220
      ]
    },
    {
      "id": "16b0aefb-b295-47ef-b818-ab133ac8190f",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        7200,
        2040
      ]
    },
    {
      "id": "d7f06346-91fc-427a-ad23-e1547180f3e3",
      "name": "Low stock Detection2",
      "type": "n8n-nodes-base.code",
      "position": [
        8380,
        1940
      ]
    },
    {
      "id": "1c054902-eb01-4f22-9e0b-31077a0ea978",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5820,
        1620
      ],
      "parameters": {
        "width": 2840,
        "height": 1380,
        "content": "# Raw Materials Receiving and Stock Update"
      }
    },
    {
      "id": "e0003f1e-1ab5-4b7e-a241-02eeed000c51",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        8720,
        1620
      ],
      "parameters": {
        "width": 2700,
        "height": 2840,
        "content": "![INVENTORY AUTOMATION SYSTEM.png](1)\n# Raw Materials Inventory Management with Google Sheets and Supabase using n8n Webhooks\n\n\n## Introduction\nThis n8n automation streamlines raw materials inventory "
      }
    },
    {
      "id": "8b6ee379-d020-44d7-892f-7b5479fa6944",
      "name": "Receive Raw Materials Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        5940,
        2040
      ]
    },
    {
      "id": "087a3182-2a5d-47a0-a3ac-33f1f3eb6a31",
      "name": "Standardize Raw Material Data",
      "type": "n8n-nodes-base.set",
      "position": [
        6160,
        2040
      ]
    },
    {
      "id": "ff7d279b-2447-4423-a0ff-4512e4a8a913",
      "name": "Lookup Existing Stock",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        7000,
        1820
      ]
    },
    {
      "id": "52698913-69d6-4473-9e77-7ef4530bf81a",
      "name": "Check If Product ID Exists",
      "type": "n8n-nodes-base.if",
      "position": [
        7420,
        2040
      ]
    },
    {
      "id": "ecc30bd0-206e-448f-952a-7a2c4ea98bc5",
      "name": "New Record Row",
      "type": "n8n-nodes-base.supabase",
      "position": [
        6700,
        2260
      ]
    },
    {
      "id": "9ffaeb38-b6fc-47f7-8611-c7da61c9cd08",
      "name": "Trigger Low Stock Alert",
      "type": "n8n-nodes-base.if",
      "position": [
        8200,
        2280
      ]
    },
    {
      "id": "469bb7fe-5595-4503-9034-8df0c974cbc2",
      "name": "Send Low Stock Email Alert",
      "type": "n8n-nodes-base.gmail",
      "position": [
        8440,
        2260
      ]
    },
    {
      "id": "24fb479d-6f25-4d69-bc5a-925645ae4837",
      "name": "Low Stock Email Alert",
      "type": "n8n-nodes-base.gmail",
      "position": [
        8540,
        3940
      ]
    },
    {
      "id": "ac8781e9-f694-467d-b40b-95bdbab98880",
      "name": "Validate Issue Request Data",
      "type": "n8n-nodes-base.code",
      "position": [
        6340,
        3400
      ]
    },
    {
      "id": "6d88db70-6b4f-47c5-8093-ab339762edbe",
      "name": "Verify Requested Quantity",
      "type": "n8n-nodes-base.code",
      "position": [
        6560,
        3400
      ]
    },
    {
      "id": "bd2313cc-e3c9-4405-a1ed-8f64969e5bca",
      "name": "Check Available Stock for Issue",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        7000,
        3240
      ]
    },
    {
      "id": "8cd87b7d-8dc8-41c7-b76e-b5ebe35278b0",
      "name": "Format Approval Response",
      "type": "n8n-nodes-base.set",
      "position": [
        6120,
        4060
      ]
    },
    {
      "id": "6749923b-1032-4adb-b805-eda6efd5ee1c",
      "name": "Verify Approval Data",
      "type": "n8n-nodes-base.code",
      "position": [
        6340,
        4060
      ]
    },
    {
      "id": "c5e34da4-81ec-47dc-aacf-4d6e0cf4256c",
      "name": "Retrieve Issue Request Details",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        6560,
        3840
      ]
    },
    {
      "id": "e3c9b60b-fa41-4ec2-9f8f-789ac4fc6323",
      "name": "Process Approval Decision",
      "type": "n8n-nodes-base.if",
      "position": [
        6980,
        4060
      ]
    },
    {
      "id": "406226c7-89b3-4a09-ba05-4b640a619ae1",
      "name": "Get Stock for Issue Update from Current",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        7220,
        3780
      ]
    },
    {
      "id": "75046f2a-7949-4280-b6a8-500848e41357",
      "name": "Update Stock After Issue",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        7240,
        4040
      ]
    },
    {
      "id": "3005f241-e0c3-4acd-9998-9b3f2cdece0c",
      "name": "Materials Issue Table Update",
      "type": "n8n-nodes-base.supabase",
      "position": [
        7220,
        4260
      ]
    },
    {
      "id": "808ce6c2-6620-40ae-8c6d-518cf28dce26",
      "name": "Is Stock is Low",
      "type": "n8n-nodes-base.if",
      "position": [
        8300,
        3960
      ]
    }
  ],
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "Check If Product ID Exists",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge1": {
      "main": [
        [
          {
            "node": "Process Approval Decision",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Stock": {
      "main": [
        [
          {
            "node": "Update Current Stock1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Update Current Stck",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Approvals": {
      "main": [
        [
          {
            "node": "Format Approval Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Lookups": {
      "main": [
        [
          {
            "node": "Prepare Approval",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Searck Issues": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "New Record Row": {
      "main": [
        [
          {
            "node": "Search Current Stock",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format response": {
      "main": [
        [
          {
            "node": "Initialize New Product stock",
            "type": "main",
            "index": 0
          },
          {
            "node": "New Row Current Stock",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Stock is Low": {
      "main": [
        [
          {
            "node": "Low Stock Email Alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Approval": {
      "main": [
        [
          {
            "node": "Send Approval Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Standardize Data": {
      "main": [
        [
          {
            "node": "Validate Issue Request Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search Product ID": {
      "main": [
        [
          {
            "node": "Merge Lookups",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Create Record Issue": {
      "main": [
        [
          {
            "node": "Search Product ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append Raw Materials": {
      "main": [
        [
          {
            "node": "Validate Quantity Received",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "LookUp Current stock": {
      "main": [
        [
          {
            "node": "Low stock Detection2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Low stock Detection1": {
      "main": [
        [
          {
            "node": "Is Stock is Low",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Low stock Detection2": {
      "main": [
        [
          {
            "node": "Trigger Low Stock Alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search Current Stock": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Current Stock": {
      "main": [
        [
          {
            "node": "LookUp Current stock",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Verify Approval Data": {
      "main": [
        [
          {
            "node": "Retrieve Issue Request Details",
            "type": "main",
            "index": 0
          },
          {
            "node": "Searck Issues",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate Total Price": {
      "main": [
        [
          {
            "node": "Append Raw Materials",
            "type": "main",
            "index": 0
          },
          {
            "node": "New Record Row",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "LookUp Current stock1": {
      "main": [
        [
          {
            "node": "Low stock Detection1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Lookup Existing Stock": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Receive Issue Request": {
      "main": [
        [
          {
            "node": "Standardize Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Current Stock1": {
      "main": [
        [
          {
            "node": "LookUp Current stock1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append Material Request": {
      "main": [
        [
          {
            "node": "Check Available Stock for Issue",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Trigger Low Stock Alert": {
      "main": [
        [
          {
            "node": "Send Low Stock Email Alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Approval Response": {
      "main": [
        [
          {
            "node": "Verify Approval Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process Approval Decision": {
      "main": [
        [
          {
            "node": "Update Stock After Issue",
            "type": "main",
            "index": 0
          },
          {
            "node": "Materials Issue Table Update",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get Stock for Issue Update from Current",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Verify Requested Quantity": {
      "main": [
        [
          {
            "node": "Append Material Request",
            "type": "main",
            "index": 0
          },
          {
            "node": "Create Record Issue",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check If Product ID Exists": {
      "main": [
        [
          {
            "node": "Calculate Updated Current Stock",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Format response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate Quantity Received": {
      "main": [
        [
          {
            "node": "Lookup Existing Stock",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate Issue Request Data": {
      "main": [
        [
          {
            "node": "Verify Requested Quantity",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Receive Raw Materials Webhook": {
      "main": [
        [
          {
            "node": "Standardize Raw Material Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Standardize Raw Material Data": {
      "main": [
        [
          {
            "node": "Calculate Total Price",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Retrieve Issue Request Details": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate Updated Current Stock": {
      "main": [
        [
          {
            "node": "Update Current Stock",
            "type": "main",
            "index": 0
          },
          {
            "node": "Current Stock Update",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Available Stock for Issue": {
      "main": [
        [
          {
            "node": "Merge Lookups",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Stock for Issue Update from Current": {
      "main": [
        [
          {
            "node": "Update Stock",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}