{
  "name": "Agent Verifier lead-to-CRM guardrail",
  "nodes": [
    {
      "parameters": {},
      "id": "manual-trigger",
      "name": "Manual Trigger",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [0, 0]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://agent-verifier.onrender.com/v1/verify/crm-record",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            { "name": "X-API-Key", "value": "={{$env.AGENT_VERIFIER_API_KEY}}" },
            { "name": "content-type", "value": "application/json" }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"company\": $json.company,\n  \"website\": $json.website,\n  \"email\": $json.email,\n  \"contact_name\": $json.contact_name,\n  \"title\": $json.title,\n  \"industry\": $json.industry,\n  \"location\": $json.location,\n  \"source\": \"n8n-ai-agent\"\n}"
      },
      "id": "verify-crm-record",
      "name": "Agent Verifier: CRM Ready?",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [260, 0]
    },
    {
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{$json.machine_readable.crm_decision}}",
              "operation": "equals",
              "value2": "write_to_crm"
            }
          ]
        }
      },
      "id": "route-safe-leads",
      "name": "Only Safe Leads Continue",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [520, 0]
    }
  ],
  "connections": {
    "Manual Trigger": {
      "main": [[{ "node": "Agent Verifier: CRM Ready?", "type": "main", "index": 0 }]]
    },
    "Agent Verifier: CRM Ready?": {
      "main": [[{ "node": "Only Safe Leads Continue", "type": "main", "index": 0 }]]
    }
  },
  "pinData": {
    "Manual Trigger": [
      {
        "json": {
          "company": "Acme Inc",
          "website": "https://acme.com",
          "email": "sales@acme.com",
          "contact_name": "Jane Smith",
          "title": "VP Sales",
          "industry": "Manufacturing",
          "location": "Pennsylvania"
        }
      }
    ]
  }
}
