{
  "name": "RTS Factory \u2014 Automatisering (Webhook)",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "new-unit",
        "responseMode": "lastNode"
      },
      "name": "Webhook \u2014 Nieuwe Unit",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        240,
        300
      ],
      "notes": "Body: { \"unit_id\": \"ger_rifleman_01\", \"source\": \"input_hotfolder\", \"deploy\": true }"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "http://python_api:8000/automate/webhook/new-unit",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ unit_id: $json.body.unit_id, source: $json.body.source || 'input_hotfolder', deploy: $json.body.deploy !== false }) }}"
      },
      "name": "Process + Deploy",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [
        480,
        300
      ]
    },
    {
      "parameters": {
        "values": {
          "string": [
            {
              "name": "message",
              "value": "=\u2705 {{ $json.unit_id }} verwerkt \u2014 open Godot en druk Play."
            }
          ]
        }
      },
      "name": "Response",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3,
      "position": [
        720,
        300
      ]
    }
  ],
  "connections": {
    "Webhook \u2014 Nieuwe Unit": {
      "main": [
        [
          {
            "node": "Process + Deploy",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process + Deploy": {
      "main": [
        [
          {
            "node": "Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "meta": {
    "description": "Import in n8n. Webhook URL na activate: http://localhost:5678/webhook/new-unit"
  }
}