{
  "name": "Flood Detection Workflow",
  "active": true,
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "flood-detection",
        "responseMode": "responseNode",
        "options": {}
      },
      "id": "webhook-1",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        240,
        300
      ]
    },
    {
      "parameters": {
        "url": "={{$node[\"Webhook\"].json[\"backend_url\"]}}/detect_flood_from_coordinates",
        "sendQuery": false,
        "sendHeaders": false,
        "sendBody": true,
        "contentType": "json",
        "body": {
          "bbox_str": "={{$node[\"Webhook\"].json[\"coordinates\"]}}",
          "analysis_date_timestamp": "={{$node[\"Webhook\"].json[\"timestamp\"]}}"
        },
        "options": {}
      },
      "id": "http-request-1",
      "name": "Call Flood Detection API",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.1,
      "position": [
        460,
        300
      ]
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": {
          "status": "success",
          "result_url": "={{$node[\"Call Flood Detection API\"].json[\"result_url\"]}}",
          "timestamp": "={{$now}}"
        }
      },
      "id": "respond-1",
      "name": "Respond to Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1,
      "position": [
        680,
        300
      ]
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict"
          },
          "conditions": [
            {
              "id": "error-check",
              "leftValue": "={{$node[\"Call Flood Detection API\"].json[\"error\"]}}",
              "rightValue": "",
              "operator": {
                "type": "string",
                "operation": "exists"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "if-1",
      "name": "Check for Errors",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        460,
        480
      ]
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": {
          "status": "error",
          "error": "={{$node[\"Call Flood Detection API\"].json[\"error\"]}}",
          "timestamp": "={{$now}}"
        }
      },
      "id": "respond-error",
      "name": "Respond with Error",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1,
      "position": [
        680,
        480
      ]
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Call Flood Detection API",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Call Flood Detection API": {
      "main": [
        [
          {
            "node": "Check for Errors",
            "type": "main",
            "index": 0
          },
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check for Errors": {
      "main": [
        [
          {
            "node": "Respond with Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "createdAt": "2025-01-19T08:00:00.000Z",
  "updatedAt": "2025-01-19T08:00:00.000Z",
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "meta": {
    "templateId": "flood-detection-workflow"
  }
}