{
  "name": "Pilot Success-Threshold Tracker",
  "nodes": [
    {
      "parameters": {
        "content": "## Setup\n1. Paste a Slack incoming webhook URL into \"Announce Threshold Reached\".\n2. Set SUCCESS_CONVERSATIONS and TOTAL_ATTEMPTS in the code node to match your own written success condition from Chapter 10.\n3. POST {\"outcome\": \"attempt\"} or {\"outcome\": \"conversation\"} to the Webhook URL each time you log an outreach attempt or a real discovery conversation.\n\nFrom Chapter 10: write your success measure and stop condition before you send a single message. This just counts against the number you already committed to on paper.",
        "height": 340,
        "width": 420
      },
      "id": "b7c8d9e0-7777-4a2b-9c3a-000000000001",
      "name": "Setup Notes",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [-200, 60]
    },
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "pilot-threshold-tracker",
        "responseMode": "onReceived",
        "options": {}
      },
      "id": "b7c8d9e0-7777-4a2b-9c3a-000000000002",
      "name": "Log Outcome Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [-200, 400]
    },
    {
      "parameters": {
        "method": "GET",
        "url": "https://api.sheetbest.com/sheets/YOUR_SHEET_ID",
        "options": {}
      },
      "id": "b7c8d9e0-7777-4a2b-9c3a-000000000003",
      "name": "Read Pilot Log",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [40, 400]
    },
    {
      "parameters": {
        "jsCode": "const SUCCESS_CONVERSATIONS = 5;\nconst TOTAL_ATTEMPTS = 15;\nconst rows = $input.first().json || [];\nconst list = Array.isArray(rows) ? rows : [];\nconst attempts = list.filter(r => r.outcome === 'attempt').length;\nconst conversations = list.filter(r => r.outcome === 'conversation').length;\nconst reached = conversations >= SUCCESS_CONVERSATIONS && attempts <= TOTAL_ATTEMPTS;\nreturn [{ json: { attempts, conversations, reached, SUCCESS_CONVERSATIONS, TOTAL_ATTEMPTS } }];"
      },
      "id": "b7c8d9e0-7777-4a2b-9c3a-000000000004",
      "name": "Check Threshold",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [280, 400]
    },
    {
      "parameters": {
        "conditions": {
          "options": { "caseSensitive": true, "leftValue": "", "typeValidation": "strict" },
          "conditions": [{ "leftValue": "={{ $json.reached }}", "rightValue": true, "operator": { "type": "boolean", "operation": "true" } }],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "b7c8d9e0-7777-4a2b-9c3a-000000000005",
      "name": "Threshold Reached?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [520, 400]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "YOUR_SLACK_INCOMING_WEBHOOK_URL",
        "sendBody": true,
        "bodyParameters": { "parameters": [{ "name": "text", "value": "=Pilot informative: {{ $json.conversations }} conversations from {{ $json.attempts }} attempts. This holds regardless of whether any of them convert — that was the point of writing the threshold down first." }] },
        "options": {}
      },
      "id": "b7c8d9e0-7777-4a2b-9c3a-000000000006",
      "name": "Announce Threshold Reached",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [760, 400]
    }
  ],
  "connections": {
    "Log Outcome Webhook": { "main": [[{ "node": "Read Pilot Log", "type": "main", "index": 0 }]] },
    "Read Pilot Log": { "main": [[{ "node": "Check Threshold", "type": "main", "index": 0 }]] },
    "Check Threshold": { "main": [[{ "node": "Threshold Reached?", "type": "main", "index": 0 }]] },
    "Threshold Reached?": { "main": [[{ "node": "Announce Threshold Reached", "type": "main", "index": 0 }], []] }
  },
  "active": false,
  "settings": { "executionOrder": "v1" },
  "pinData": {}
}
