{
  "name": "AI Data Platform - Webhook Ingestion",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "trigger-ingestion",
        "responseMode": "responseNode",
        "options": {}
      },
      "id": "webhook-trigger",
      "name": "Webhook Trigger",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        200,
        300
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "http://api:8000/ingest",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "csv_file_path",
              "value": "={{ $json.csv_file_path || 'ads_spend.csv' }}"
            },
            {
              "name": "batch_id",
              "value": "={{ $json.batch_id || 'webhook_batch_' + new Date().getTime() }}"
            }
          ]
        },
        "options": {
          "timeout": 30000
        }
      },
      "id": "http-request",
      "name": "Trigger Data Ingestion",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 3,
      "position": [
        500,
        300
      ]
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ { \"status\": \"success\", \"message\": \"Data ingestion triggered\", \"batch_id\": $('Trigger Data Ingestion').first().json.batch_id, \"timestamp\": new Date().toISOString() } }}"
      },
      "id": "webhook-response",
      "name": "Webhook Response",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1,
      "position": [
        800,
        300
      ]
    }
  ],
  "connections": {
    "Webhook Trigger": {
      "main": [
        [
          {
            "node": "Trigger Data Ingestion",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Trigger Data Ingestion": {
      "main": [
        [
          {
            "node": "Webhook Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  }
}