{
  "name": "Snapi — Time-Off Requests",
  "nodes": [
    {
      "parameters": {
        "content": "## Time-Off Requests\n\nReceives Snapi's `card.moved` webhook when someone drags a card to **Approved** on the board, and branches on the decision.\n\n**Setup**\n1. Copy this Webhook node's Production URL.\n2. In Snapi, open the Time-off request form → **Webhooks** → paste it as the *post-webhook*.\n3. Activate.\n\nDecision: `{{ $json.body.to_column.name }}` · Data: `{{ $json.body.record.data }}`",
        "height": 300,
        "width": 380
      },
      "id": "note-time-off",
      "name": "Read me first",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -160,
        40
      ]
    },
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "snapi-time-off",
        "responseMode": "onReceived",
        "options": {}
      },
      "id": "hook-time-off",
      "name": "Snapi card moved",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        300,
        200
      ],
      "webhookId": "snapi-time-off"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "loose"
          },
          "conditions": [
            {
              "id": "cond-go",
              "leftValue": "={{ $json.body.to_column.name }}",
              "rightValue": "Approved",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "if-time-off",
      "name": "Approved?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        560,
        200
      ]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "a-ref",
              "name": "ref",
              "value": "={{ $json.body.record.data.ref_no }}",
              "type": "string"
            },
            {
              "id": "a-decision",
              "name": "decision",
              "value": "approved",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "set-go-time-off",
      "name": "Do the approved action",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        820,
        120
      ]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "r-ref",
              "name": "ref",
              "value": "={{ $json.body.record.data.ref_no }}",
              "type": "string"
            },
            {
              "id": "r-decision",
              "name": "decision",
              "value": "={{ $json.body.to_column.name }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "set-other-time-off",
      "name": "Handle other outcomes",
      "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 other outcomes",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "pinData": {},
  "tags": [
    {
      "name": "Snapi"
    }
  ]
}
