{
  "name": "Order processing with Google Sheets and Slack: inventory checks and alerts",
  "nodes": [
    {
      "id": "530ff29c-9bdf-4968-8249-f2f7bb7a00fb",
      "name": "Order Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -560,
        32
      ]
    },
    {
      "id": "a9abbf93-090a-4861-8040-35f9a6262502",
      "name": "Check Order",
      "type": "n8n-nodes-base.function",
      "position": [
        -352,
        32
      ]
    },
    {
      "id": "a2a36044-2235-4aff-a685-4665ff8a6fbc",
      "name": "Request Info",
      "type": "n8n-nodes-base.function",
      "position": [
        -144,
        32
      ]
    },
    {
      "id": "b86ca7ce-935d-42f1-a6a0-e851d489b306",
      "name": "Item and quantity",
      "type": "n8n-nodes-base.function",
      "position": [
        80,
        32
      ]
    },
    {
      "id": "bfb3179e-2337-4e34-9270-e8b5bb2c3836",
      "name": "Get Inventories",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        304,
        -80
      ]
    },
    {
      "id": "2ac676e9-dfc9-4744-8cc2-efe76b85920a",
      "name": "Mapping data",
      "type": "n8n-nodes-base.merge",
      "position": [
        544,
        16
      ]
    },
    {
      "id": "a6407f6f-416c-441e-b25c-427168e48f7f",
      "name": "enough stock?",
      "type": "n8n-nodes-base.if",
      "position": [
        784,
        16
      ]
    },
    {
      "id": "bf3892bd-9fad-4bd2-a7b1-c21aa60e21a4",
      "name": "Create Invoice",
      "type": "n8n-nodes-base.function",
      "position": [
        1040,
        -96
      ]
    },
    {
      "id": "ac99fbed-8bac-4c40-a39c-1f2855e110e7",
      "name": "create data logs (success)",
      "type": "n8n-nodes-base.function",
      "position": [
        1536,
        -96
      ]
    },
    {
      "id": "9b7cf0fc-c6e7-4829-a4f9-eb22eef42285",
      "name": "create data logs (Stock shortage)",
      "type": "n8n-nodes-base.function",
      "position": [
        1536,
        80
      ]
    },
    {
      "id": "45dc92c9-bfc9-4be2-a2fb-1aa89c557011",
      "name": "Save logs",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1792,
        16
      ]
    },
    {
      "id": "977bd121-fc39-4505-b0d0-0eb8bd6a4137",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1536,
        -432
      ],
      "parameters": {
        "width": 848,
        "height": 1440,
        "content": "## Overview\nA cornerstone of your Order Management System, this workflow ensures seamless inventory control through fully automated stock checks, leading to a direct reduction in operational costs. It"
      }
    },
    {
      "id": "68784936-2e4b-482a-86a0-745104fef6b5",
      "name": "Slack notification (OK)",
      "type": "n8n-nodes-base.slack",
      "position": [
        1296,
        -96
      ]
    },
    {
      "id": "c47c7b84-caa8-49ff-8a47-52e22ff28027",
      "name": "Slack notification (Stock shortage)",
      "type": "n8n-nodes-base.slack",
      "position": [
        1296,
        80
      ]
    },
    {
      "id": "89964e97-c855-425f-a006-244dc9a54939",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -640,
        -224
      ],
      "parameters": {
        "width": 848,
        "height": 480,
        "content": "## Order Request\nAfterwards, process the data to determine the product and the ordered quantity."
      }
    },
    {
      "id": "1ad2d9e5-27c4-4eba-9fb4-88fef7164a6f",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        256,
        -224
      ],
      "parameters": {
        "width": 672,
        "height": 480,
        "content": "## Check Inventory\nRetrieve inventory information and compare it with the order request."
      }
    },
    {
      "id": "a9e885fc-aa38-47f4-aa97-1a5abf4bcddb",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        976,
        -224
      ],
      "parameters": {
        "width": 480,
        "height": 480,
        "content": "## Notifications\nGenerate a notification to Slack for the manager indicating a successful order or an out-of-stock situation."
      }
    },
    {
      "id": "17a2cd56-592a-4329-b7a9-3ccbb2e3028f",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1488,
        -224
      ],
      "parameters": {
        "width": 496,
        "height": 480,
        "content": "## Logging\nLog the process details to a Google Sheet for tracking."
      }
    }
  ],
  "connections": {
    "Check Order": {
      "main": [
        [
          {
            "node": "Request Info",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mapping data": {
      "main": [
        [
          {
            "node": "enough stock?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Request Info": {
      "main": [
        [
          {
            "node": "Item and quantity",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Order Webhook": {
      "main": [
        [
          {
            "node": "Check Order",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "enough stock?": {
      "main": [
        [
          {
            "node": "Create Invoice",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Slack notification (Stock shortage)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Invoice": {
      "main": [
        [
          {
            "node": "Slack notification (OK)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Inventories": {
      "main": [
        [
          {
            "node": "Mapping data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Item and quantity": {
      "main": [
        [
          {
            "node": "Get Inventories",
            "type": "main",
            "index": 0
          },
          {
            "node": "Mapping data",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Slack notification (OK)": {
      "main": [
        [
          {
            "node": "create data logs (success)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "create data logs (success)": {
      "main": [
        [
          {
            "node": "Save logs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "create data logs (Stock shortage)": {
      "main": [
        [
          {
            "node": "Save logs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Slack notification (Stock shortage)": {
      "main": [
        [
          {
            "node": "create data logs (Stock shortage)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}