{
  "name": "Snapi — Approval Queue",
  "nodes": [
    {
      "parameters": {
        "content": "## Snapi Approval Queue\n\nThis workflow receives Snapi's `card.moved` webhook when someone drags a request to **Approved** or **Rejected** on the board, and branches on the decision.\n\n**Setup**\n1. Open the **Webhook** node, copy its Production URL.\n2. In Snapi, open your Request form → **Webhooks** → paste it as the *post-webhook*.\n3. Activate this workflow.\n\nThe decision is at `{{ $json.body.to_column.name }}` and the submitted data at `{{ $json.body.record.data }}`.",
        "height": 300,
        "width": 380
      },
      "id": "b1a1c0de-0001-4a00-9000-000000000001",
      "name": "Read me first",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [-160, 40]
    },
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "snapi-approval",
        "responseMode": "onReceived",
        "options": {}
      },
      "id": "b1a1c0de-0002-4a00-9000-000000000002",
      "name": "Snapi card moved",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [300, 200],
      "webhookId": "snapi-approval-queue"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "loose"
          },
          "conditions": [
            {
              "id": "cond-approved",
              "leftValue": "={{ $json.body.to_column.name }}",
              "rightValue": "Approved",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "b1a1c0de-0003-4a00-9000-000000000003",
      "name": "Approved?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [560, 200]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "a-title",
              "name": "request",
              "value": "={{ $json.body.record.data.title }}",
              "type": "string"
            },
            {
              "id": "a-amount",
              "name": "amount",
              "value": "={{ $json.body.record.data.amount }}",
              "type": "number"
            },
            {
              "id": "a-decision",
              "name": "decision",
              "value": "approved",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "b1a1c0de-0004-4a00-9000-000000000004",
      "name": "Do the approved action",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [820, 120]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "r-title",
              "name": "request",
              "value": "={{ $json.body.record.data.title }}",
              "type": "string"
            },
            {
              "id": "r-decision",
              "name": "decision",
              "value": "rejected",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "b1a1c0de-0005-4a00-9000-000000000005",
      "name": "Handle rejection",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [820, 300]
    }
  ],
  "connections": {
    "Snapi card moved": {
      "main": [
        [
          {
            "node": "Approved?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Approved?": {
      "main": [
        [
          {
            "node": "Do the approved action",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Handle rejection",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "pinData": {},
  "tags": [
    {
      "name": "Snapi"
    }
  ]
}
