{
 "name": "Verdika · verificar antes de ejecutar",
 "nodes": [
  {
   "parameters": {},
   "id": "a1",
   "name": "Inicio manual",
   "type": "n8n-nodes-base.manualTrigger",
   "typeVersion": 1,
   "position": [
    0,
    0
   ]
  },
  {
   "parameters": {
    "method": "POST",
    "url": "https://verdika.pro/v1/verify",
    "sendHeaders": true,
    "headerParameters": {
     "parameters": [
      {
       "name": "Authorization",
       "value": "Bearer vk_TU_CLAVE"
      }
     ]
    },
    "sendBody": true,
    "specifyBody": "json",
    "jsonBody": "={\n  \"action\": \"Subir precios 20% a toda la base de clientes\",\n  \"alternatives\": [\"Subir solo a clientes nuevos\"],\n  \"evidence\": [{\"content\": \"Churn mensual 3.1%\", \"source\": \"CRM\"}],\n  \"agent\": {\"name\": \"n8n\", \"run_id\": \"{{ $execution.id }}\"}\n}",
    "options": {
     "timeout": 120000
    }
   },
   "id": "a2",
   "name": "Verdika: verificar",
   "type": "n8n-nodes-base.httpRequest",
   "typeVersion": 4.2,
   "position": [
    240,
    0
   ]
  },
  {
   "parameters": {
    "rules": {
     "values": [
      {
       "conditions": {
        "options": {
         "caseSensitive": true,
         "typeValidation": "strict"
        },
        "conditions": [
         {
          "leftValue": "={{ $json.verdict }}",
          "rightValue": "approve",
          "operator": {
           "type": "string",
           "operation": "equals"
          }
         }
        ],
        "combinator": "and"
       },
       "renameOutput": true,
       "outputKey": "approve"
      },
      {
       "conditions": {
        "options": {
         "caseSensitive": true,
         "typeValidation": "strict"
        },
        "conditions": [
         {
          "leftValue": "={{ $json.verdict }}",
          "rightValue": "review",
          "operator": {
           "type": "string",
           "operation": "equals"
          }
         }
        ],
        "combinator": "and"
       },
       "renameOutput": true,
       "outputKey": "review"
      },
      {
       "conditions": {
        "options": {
         "caseSensitive": true,
         "typeValidation": "strict"
        },
        "conditions": [
         {
          "leftValue": "={{ $json.verdict }}",
          "rightValue": "block",
          "operator": {
           "type": "string",
           "operation": "equals"
          }
         }
        ],
        "combinator": "and"
       },
       "renameOutput": true,
       "outputKey": "block"
      }
     ]
    },
    "options": {}
   },
   "id": "a3",
   "name": "Según veredicto",
   "type": "n8n-nodes-base.switch",
   "typeVersion": 3.2,
   "position": [
    480,
    0
   ]
  }
 ],
 "connections": {
  "Inicio manual": {
   "main": [
    [
     {
      "node": "Verdika: verificar",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "Verdika: verificar": {
   "main": [
    [
     {
      "node": "Según veredicto",
      "type": "main",
      "index": 0
     }
    ]
   ]
  }
 },
 "settings": {
  "executionOrder": "v1"
 }
}