{
  "name": "Handle approval requests with SendGrid email and Baserow records",
  "nodes": [
    {
      "id": "d56b5b5a-2256-4126-b430-000c2d4a983d",
      "name": "📝 Workflow Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -224,
        -80
      ],
      "parameters": {
        "width": 550,
        "height": 722,
        "content": "## How it works\nThis workflow orchestrates a complete approval lifecycle from submission to resolution. A manual trigger kicks things off, after which incoming request data is verified for completenes"
      }
    },
    {
      "id": "82c16db2-2402-474d-81b9-9ef8d6eaaaaa",
      "name": "Section • Trigger & Validation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        432,
        -48
      ],
      "parameters": {
        "width": 658,
        "height": 782,
        "content": "## Trigger & Validation\nThis group covers the initial kick-off and data hygiene.  The Manual Trigger acts as the entry point—ideal for testing or external API calls via the *Execute Workflow* endpoint"
      }
    },
    {
      "id": "b047a5f7-ef49-46e4-8c36-fac14d6f5952",
      "name": "Section • Notify & Wait",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1088,
        -32
      ],
      "parameters": {
        "width": 930,
        "height": 782,
        "content": "## Notification & Await Response\nOnce a request is verified, we calculate the correct approver (e.g., based on department rules) and send a nicely formatted SendGrid email containing request details a"
      }
    },
    {
      "id": "dd65d721-f1ac-4303-a6a8-f4e89c6a0e61",
      "name": "Section • Post-Processing",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2016,
        -32
      ],
      "parameters": {
        "width": 1074,
        "height": 782,
        "content": "## Post-Processing & Storage\nAfter resumption, an IF node evaluates the `approved` flag.  Approved requests update the Baserow row to **Approved**, rejected ones to **Rejected**.  Each path sends a fo"
      }
    },
    {
      "id": "4efef463-7024-4e0c-a425-3d0660a21659",
      "name": "Start Workflow",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        432,
        304
      ]
    },
    {
      "id": "2198a03b-33e3-48d6-9323-65421cd2f283",
      "name": "Validate Request Data",
      "type": "n8n-nodes-base.code",
      "position": [
        624,
        304
      ]
    },
    {
      "id": "c7233538-6f32-4d57-8f89-94b9c5b74256",
      "name": "Is Request Valid?",
      "type": "n8n-nodes-base.if",
      "position": [
        832,
        304
      ]
    },
    {
      "id": "f176b3f4-fb4e-4333-9c0f-d7f3e57385c8",
      "name": "Send Invalid Input Alert",
      "type": "n8n-nodes-base.sendGrid",
      "position": [
        1024,
        208
      ]
    },
    {
      "id": "8f89825d-aa55-4139-99e9-1063c55e0458",
      "name": "Determine Approver",
      "type": "n8n-nodes-base.code",
      "position": [
        1024,
        416
      ]
    },
    {
      "id": "237ecb70-492f-4135-b648-6fec9f5de2cd",
      "name": "Notify Approver",
      "type": "n8n-nodes-base.sendGrid",
      "position": [
        1232,
        416
      ]
    },
    {
      "id": "41d8e6e9-2139-4234-9492-90c5f7003328",
      "name": "Create Pending Record",
      "type": "n8n-nodes-base.baserow",
      "position": [
        1424,
        416
      ]
    },
    {
      "id": "03ebac20-7f65-42d5-a8c8-451d1f93d312",
      "name": "Wait for Approval Response",
      "type": "n8n-nodes-base.wait",
      "position": [
        1632,
        416
      ]
    },
    {
      "id": "e42434ae-916a-47b1-b425-22401469640b",
      "name": "Extract Approval Result",
      "type": "n8n-nodes-base.set",
      "position": [
        1824,
        416
      ]
    },
    {
      "id": "37303efd-54c0-40e7-b976-9e423b1b763c",
      "name": "Approved?",
      "type": "n8n-nodes-base.if",
      "position": [
        2032,
        416
      ]
    },
    {
      "id": "9ce32909-83b8-4918-8e2e-746e06e73ba2",
      "name": "Update Record – Approved",
      "type": "n8n-nodes-base.baserow",
      "position": [
        2224,
        304
      ]
    },
    {
      "id": "b2302eaf-d92e-4b11-a8c7-03c6b3bc4c27",
      "name": "Notify Requester – Approved",
      "type": "n8n-nodes-base.sendGrid",
      "position": [
        2432,
        304
      ]
    },
    {
      "id": "c63597b1-3486-414e-a4d2-adfedad9c11c",
      "name": "Update Record – Rejected",
      "type": "n8n-nodes-base.baserow",
      "position": [
        2224,
        512
      ]
    },
    {
      "id": "5f884da2-c06c-48fe-974c-7772e3dac49a",
      "name": "Notify Requester – Rejected",
      "type": "n8n-nodes-base.sendGrid",
      "position": [
        2432,
        512
      ]
    },
    {
      "id": "c71ad01e-a594-46bc-9593-d57b852d30fa",
      "name": "Join End Paths",
      "type": "n8n-nodes-base.merge",
      "position": [
        2624,
        416
      ]
    },
    {
      "id": "37feeb27-667c-4686-aec6-0de4063da06c",
      "name": "Finalize",
      "type": "n8n-nodes-base.code",
      "position": [
        2832,
        416
      ]
    }
  ],
  "connections": {
    "Approved?": {
      "main": [
        [
          {
            "node": "Update Record – Approved",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Update Record – Rejected",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Join End Paths": {
      "main": [
        [
          {
            "node": "Finalize",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Start Workflow": {
      "main": [
        [
          {
            "node": "Validate Request Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Notify Approver": {
      "main": [
        [
          {
            "node": "Create Pending Record",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Request Valid?": {
      "main": [
        [
          {
            "node": "Determine Approver",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Invalid Input Alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Determine Approver": {
      "main": [
        [
          {
            "node": "Notify Approver",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Pending Record": {
      "main": [
        [
          {
            "node": "Wait for Approval Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate Request Data": {
      "main": [
        [
          {
            "node": "Is Request Valid?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Approval Result": {
      "main": [
        [
          {
            "node": "Approved?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Invalid Input Alert": {
      "main": [
        [
          {
            "node": "Join End Paths",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Update Record – Approved": {
      "main": [
        [
          {
            "node": "Notify Requester – Approved",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Record – Rejected": {
      "main": [
        [
          {
            "node": "Notify Requester – Rejected",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait for Approval Response": {
      "main": [
        [
          {
            "node": "Extract Approval Result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Notify Requester – Approved": {
      "main": [
        [
          {
            "node": "Join End Paths",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Notify Requester – Rejected": {
      "main": [
        [
          {
            "node": "Join End Paths",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}