{
  "name": "Book AI Processing",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "book-ai-processing",
        "options": {}
      },
      "id": "webhook_trigger",
      "name": "Webhook Trigger",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "={{ 'http://localhost:5000/api/ai-processing/process-book/' + $json.body.book_id }}",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer {{YOUR_JWT_TOKEN_HERE}}"
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ triggered_by: 'n8n_webhook', action: $json.body.action, updated_fields: $json.body.updated_fields, timestamp: new Date().toISOString() }) }}",
        "options": {}
      },
      "id": "call_book_ai_api",
      "name": "Process Book AI",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 3,
      "position": [
        450,
        300
      ]
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ JSON.stringify({ status: 'success', message: 'Book AI processing completed', book_id: $json.body.book_id, ai_fields: $json.ai_fields || {}, timestamp: new Date().toISOString() }) }}",
        "options": {}
      },
      "id": "success_response",
      "name": "Success Response",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1,
      "position": [
        650,
        300
      ]
    }
  ],
  "connections": {
    "Webhook Trigger": {
      "main": [
        [
          {
            "node": "Process Book AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process Book AI": {
      "main": [
        [
          {
            "node": "Success Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "tags": [
    "ai",
    "book",
    "webhook",
    "processing",
    "automation"
  ]
}