{
  "name": "Bookings",
  "nodes": [
    {
      "parameters": {
        "path": "bookings-list",
        "authentication": "jwtAuth",
        "responseMode": "responseNode",
        "options": {}
      },
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        -340,
        -40
      ],
      "id": "6a49b655-b040-44b7-bdf1-0663319cd30c",
      "name": "Webhook",
      "credentials": {
        "jwtAuth": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "decode",
        "token": "={{ $('Webhook').first().json.headers.authorization.split(' ').pop() }}",
        "options": {
          "complete": true
        }
      },
      "type": "n8n-nodes-base.jwt",
      "typeVersion": 1,
      "position": [
        -100,
        -40
      ],
      "id": "437041f7-2dbb-45fb-bab1-6d0d624fa888",
      "name": "JWT",
      "credentials": {
        "jwtAuth": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "collection": "users",
        "options": {},
        "query": "={\n  \"email\": \"{{$('JWT').first().json.payload.email}}\"\n}"
      },
      "type": "n8n-nodes-base.mongoDb",
      "typeVersion": 1.2,
      "position": [
        160,
        -40
      ],
      "id": "e25892bd-e2bc-4748-ba47-04e4302f5448",
      "name": "MongoDB",
      "credentials": {
        "mongoDb": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "collection": "bookings",
        "options": {
          "sort": "={\n  \"created_at\": -1\n}"
        },
        "query": "={\n  \"user_id\": \"{{ $('MongoDB').first().json._id }}\"\n}"
      },
      "type": "n8n-nodes-base.mongoDb",
      "typeVersion": 1.2,
      "position": [
        380,
        -40
      ],
      "id": "b20d5acb-1158-4d21-92b5-85ffbe037a9c",
      "name": "MongoDB1",
      "credentials": {
        "mongoDb": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "respondWith": "allIncomingItems",
        "options": {}
      },
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.3,
      "position": [
        600,
        -40
      ],
      "id": "f81b4406-50ea-4613-822b-fe0a81aabb68",
      "name": "Respond to Webhook"
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "JWT",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "JWT": {
      "main": [
        [
          {
            "node": "MongoDB",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "MongoDB": {
      "main": [
        [
          {
            "node": "MongoDB1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "MongoDB1": {
      "main": [
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": true,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "664575fa-ae2e-4837-aaf0-2c4a7fce91d2",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "UqJXdHite2tsxJUv",
  "tags": []
}