{
  "name": "AiGentsy — Proof Created → Slack Notification",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "aigentsy-webhook",
        "responseMode": "onReceived",
        "responseData": "allEntries"
      },
      "id": "webhook-trigger",
      "name": "AiGentsy Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [250, 300]
    },
    {
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{ $json.event }}",
              "operation": "equals",
              "value2": "proof.created"
            }
          ]
        }
      },
      "id": "filter-event",
      "name": "Filter: proof.created",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [470, 300]
    },
    {
      "parameters": {
        "channel": "#agent-proofs",
        "text": "=New proof created!\n\nDeal: {{ $json.payload.deal_id }}\nAgent: {{ $json.payload.agent_id || 'N/A' }}\nDescription: {{ $json.payload.description || $json.payload.scope_summary || 'N/A' }}\nVerify: https://aigentsy.com/verify.html?deal={{ $json.payload.deal_id }}\nPDF: https://aigentsy-ame-runtime.onrender.com/protocol/proofs/{{ $json.payload.deal_id }}/export?format=pdf"
      },
      "id": "slack-message",
      "name": "Slack: Post Proof",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 1,
      "position": [690, 280]
    }
  ],
  "connections": {
    "AiGentsy Webhook": {
      "main": [
        [{ "node": "Filter: proof.created", "type": "main", "index": 0 }]
      ]
    },
    "Filter: proof.created": {
      "main": [
        [{ "node": "Slack: Post Proof", "type": "main", "index": 0 }]
      ]
    }
  },
  "meta": {
    "description": "Receives AiGentsy webhook events and posts proof.created notifications to Slack. Import this workflow into n8n, then register the webhook URL with AiGentsy: POST /protocol/webhooks {\"url\":\"YOUR_N8N_WEBHOOK_URL\",\"events\":[\"proof.created\"]}",
    "templateCreatedBy": "AiGentsy"
  }
}
