{
  "name": "GraphKit: leads in, replies out",
  "nodes": [
    {
      "parameters": {
        "content": "## GraphKit template\n\n**Flow 1 (top):** any form or tool POSTs a lead to the *Lead in* webhook, and n8n adds it to GraphKit through a lead hook.\nReplace `REPLACE_WITH_LEAD_HOOK_URL` and `REPLACE_WITH_LEAD_HOOK_SECRET` (GraphKit → Integrations → Lead hooks).\n\n**Flow 2 (bottom):** GraphKit sends `lead.replied` to the *GraphKit events* webhook, and n8n adds the lead to a list with the REST API.\nIn GraphKit → Integrations, add an endpoint with this webhook's production URL and subscribe it to `lead.replied` only.\nReplace `REPLACE_WITH_API_URL`, `REPLACE_WITH_LIST_ID` and `REPLACE_WITH_API_KEY` (Settings → API keys, scope `leads:write`).\n\nTo verify GraphKit signatures, turn on *Raw Body* in the webhook and add a Crypto node (Hmac, SHA256, HEX) over `<GraphKit-Timestamp>.<raw body>`; see docs.graphkit.com/guides/automation.",
        "height": 420,
        "width": 520
      },
      "id": "6c1d2a10-0b5e-4f3a-9c61-1f0f6a6d0a01",
      "name": "About this template",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [-520, 0]
    },
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "graphkit-lead-in",
        "responseMode": "onReceived",
        "options": {}
      },
      "id": "6c1d2a10-0b5e-4f3a-9c61-1f0f6a6d0a02",
      "name": "Lead in",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [80, 80],
      "webhookId": "0f6f2a8e-3d55-4d8e-9a43-6a3c2f1b7e01"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "REPLACE_WITH_LEAD_HOOK_URL",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            { "name": "Authorization", "value": "Bearer REPLACE_WITH_LEAD_HOOK_SECRET" },
            { "name": "Idempotency-Key", "value": "={{ $execution.id }}" }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ firstName: $json.body.firstName, lastName: $json.body.lastName, email: $json.body.email, linkedinUrl: $json.body.linkedinUrl, companyName: $json.body.company }) }}",
        "options": {}
      },
      "id": "6c1d2a10-0b5e-4f3a-9c61-1f0f6a6d0a03",
      "name": "Add lead to GraphKit",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [320, 80]
    },
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "graphkit-events",
        "responseMode": "onReceived",
        "options": {}
      },
      "id": "6c1d2a10-0b5e-4f3a-9c61-1f0f6a6d0a04",
      "name": "GraphKit events",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [80, 320],
      "webhookId": "0f6f2a8e-3d55-4d8e-9a43-6a3c2f1b7e02"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "=REPLACE_WITH_API_URL/api/v1/lists/REPLACE_WITH_LIST_ID/leads",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            { "name": "Authorization", "value": "Bearer REPLACE_WITH_API_KEY" },
            { "name": "Idempotency-Key", "value": "={{ $json.body.id }}" }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ leadIds: [$json.body.data.lead.id] }) }}",
        "options": {}
      },
      "id": "6c1d2a10-0b5e-4f3a-9c61-1f0f6a6d0a05",
      "name": "Add replier to list",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [320, 320]
    }
  ],
  "connections": {
    "Lead in": { "main": [[{ "node": "Add lead to GraphKit", "type": "main", "index": 0 }]] },
    "GraphKit events": { "main": [[{ "node": "Add replier to list", "type": "main", "index": 0 }]] }
  },
  "pinData": {},
  "settings": { "executionOrder": "v1" },
  "meta": { "templateCredsSetupCompleted": true }
}
