{
  "name": "Stage-Triggered Micro-Coaching",
  "nodes": [
    {
      "id": "80a04052-8ac5-443b-a38b-4f66aca8a150",
      "name": "Business-Hours Stage Check",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        100,
        300
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "20 8-18 * * 1-5"
            }
          ]
        }
      }
    },
    {
      "id": "71c4e363-45d6-49be-8f55-7879caf06b07",
      "name": "Get Open Opportunities",
      "type": "n8n-nodes-base.salesforce",
      "typeVersion": 1.1,
      "position": [
        300,
        300
      ],
      "parameters": {
        "resource": "search",
        "operation": "query",
        "query": "SELECT Id, Name, StageName, Amount, CloseDate, Description, NextStep, Account.Name, Account.Industry FROM Opportunity WHERE IsClosed = false"
      },
      "credentials": {
        "salesforceOAuth2Api": {
          "id": "553Tae1kPe5Wpthq",
          "name": "Salesforce account"
        }
      },
      "executeOnce": true
    },
    {
      "id": "253cdad9-af33-404c-a52b-7e0b686f99b0",
      "name": "Get Deal Owners",
      "type": "n8n-nodes-base.dataTable",
      "typeVersion": 1.1,
      "position": [
        500,
        300
      ],
      "parameters": {
        "resource": "row",
        "operation": "get",
        "dataTableId": {
          "__rl": true,
          "mode": "id",
          "value": "ndaqm3DMnnIJFO4F",
          "cachedResultName": "Seeded Deal Owners"
        },
        "returnAll": true
      },
      "executeOnce": true
    },
    {
      "id": "f5358998-681b-4272-a0bb-c871a9e16e88",
      "name": "Get Rep Roster",
      "type": "n8n-nodes-base.dataTable",
      "typeVersion": 1.1,
      "position": [
        700,
        300
      ],
      "parameters": {
        "resource": "row",
        "operation": "get",
        "dataTableId": {
          "__rl": true,
          "mode": "id",
          "value": "Sad8yEC4yhiM2VXY",
          "cachedResultName": "Seeded Rep Roster (Ramp)"
        },
        "returnAll": true
      },
      "executeOnce": true
    },
    {
      "id": "a2107141-e51b-4a47-bcc9-055ce3cef13f",
      "name": "Get Stage Playbooks",
      "type": "n8n-nodes-base.dataTable",
      "typeVersion": 1.1,
      "position": [
        900,
        300
      ],
      "parameters": {
        "resource": "row",
        "operation": "get",
        "dataTableId": {
          "__rl": true,
          "mode": "id",
          "value": "VJ23vBLncMxubkGC",
          "cachedResultName": "Stage Playbooks"
        },
        "returnAll": true
      },
      "executeOnce": true
    },
    {
      "id": "f3d9f890-586a-4e3b-b52a-36b33e2f8754",
      "name": "Get Content Library",
      "type": "n8n-nodes-base.dataTable",
      "typeVersion": 1.1,
      "position": [
        1100,
        300
      ],
      "parameters": {
        "resource": "row",
        "operation": "get",
        "dataTableId": {
          "__rl": true,
          "mode": "id",
          "value": "2gf7i5SufszxuRHG",
          "cachedResultName": "Enablement Content Library"
        },
        "returnAll": true
      },
      "executeOnce": true
    },
    {
      "id": "f5151649-da49-45bf-bcc1-8a8c5e6425b1",
      "name": "Get Coaching Snapshot",
      "type": "n8n-nodes-base.dataTable",
      "typeVersion": 1.1,
      "position": [
        1300,
        300
      ],
      "parameters": {
        "resource": "row",
        "operation": "get",
        "dataTableId": {
          "__rl": true,
          "mode": "id",
          "value": "mqMF5PcOECgVanaQ",
          "cachedResultName": "Coaching Stage Snapshot"
        },
        "returnAll": true
      },
      "executeOnce": true,
      "alwaysOutputData": true
    },
    {
      "id": "a809a651-078a-431c-a24f-a3c7997f4954",
      "name": "Get Coaching Log",
      "type": "n8n-nodes-base.dataTable",
      "typeVersion": 1.1,
      "position": [
        1500,
        300
      ],
      "parameters": {
        "resource": "row",
        "operation": "get",
        "dataTableId": {
          "__rl": true,
          "mode": "id",
          "value": "b7Gn2C5Lh0GdZYNb",
          "cachedResultName": "Coaching Log"
        },
        "returnAll": true
      },
      "executeOnce": true,
      "alwaysOutputData": true
    },
    {
      "id": "805e31f8-d768-4f58-bb81-325a16fdf0e9",
      "name": "Detect First-Time Stage Entries",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1700,
        300
      ],
      "parameters": {
        "mode": "runOnceForAllItems",
        "jsCode": "// Who gets coached, decided in code: a rep still in ramp (first 180 days) whose deal just entered a stage\n// they have not been coached on before. Tenured reps and repeat stages are skipped and counted.\nconst runDate = $today.toFormat('yyyy-MM-dd');\nconst DAY = 86400000, RAMP_DAYS = 180;\nconst days = (a, b) => Math.round((Date.parse(b + 'T00:00:00Z') - Date.parse(String(a).slice(0, 10) + 'T00:00:00Z')) / DAY);\nconst BUCKET = { 'Prospecting': 'Qualification', 'Qualification': 'Qualification',\n  'Needs Analysis': 'Discovery', 'Value Proposition': 'Discovery', 'Id. Decision Makers': 'Discovery', 'Perception Analysis': 'Discovery',\n  'Proposal/Price Quote': 'Proposal', 'Proposal/Negotiation': 'Proposal', 'Negotiation/Review': 'Negotiation' };\nconst open = $('Get Open Opportunities').all().map(i => i.json).filter(r => r.Id);\nconst owner = {}; for (const o of $('Get Deal Owners').all().map(i => i.json).filter(r => r.opportunityId)) owner[o.opportunityId] = o.rep;\nconst reps = {}; for (const r of $('Get Rep Roster').all().map(i => i.json).filter(r => r.rep)) reps[r.rep] = r;\nconst books = {}; for (const b of $('Get Stage Playbooks').all().map(i => i.json).filter(r => r.stage)) books[b.stage] = b;\nconst lib = $('Get Content Library').all().map(i => i.json).filter(a => a.assetId);\nconst prev = {}; for (const s of $('Get Coaching Snapshot').all().map(i => i.json).filter(r => r.dealId)) prev[s.dealId] = s.stage;\nconst coached = new Set($('Get Coaching Log').all().map(i => i.json).filter(r => r.rep).map(r => r.rep + '|' + r.stage));\nconst split = s => String(s || '').split(',').map(x => x.trim()).filter(Boolean);\nconst ORDER = { Qualification: 1, Discovery: 2, Proposal: 3, Negotiation: 4 };\n\nconst moments = [], snapshotRows = [];\nconst stats = { openDeals: open.length, withSeededOwner: 0, baseline: 0, stageChanges: 0, skippedTenured: 0, skippedAlreadyCoached: 0, movedBack: 0 };\nfor (const o of open) {\n  snapshotRows.push({ dealId: o.Id, dealName: o.Name, stage: o.StageName, seenAt: $now.toISO() });\n  const rep = owner[o.Id];\n  if (!rep || !reps[rep]) continue;\n  stats.withSeededOwner++;\n  if (prev[o.Id] === undefined) { stats.baseline++; continue; }   // first sighting is a baseline, not a stage entry\n  if (prev[o.Id] === o.StageName) continue;\n  const stage = BUCKET[o.StageName];\n  if (!stage || BUCKET[prev[o.Id]] === stage) continue;          // only a move into a new stage bucket counts\n  if (BUCKET[prev[o.Id]] && ORDER[stage] < ORDER[BUCKET[prev[o.Id]]]) { stats.movedBack++; continue; }   // a deal moving backwards is not a new stage to coach\n  stats.stageChanges++;\n  const tenureDays = days(reps[rep].startDate, runDate);\n  if (tenureDays >= RAMP_DAYS) { stats.skippedTenured++; continue; }\n  if (coached.has(rep + '|' + stage)) { stats.skippedAlreadyCoached++; continue; }\n  const book = books[stage];\n  if (!book) continue;\n  const industry = (o.Account || {}).Industry || '';\n  // Stage assets: built for this stage entry, no competitor, industry fits. Anything the Stale Content Auditor marked is held back.\n  const fits = lib.filter(a => split(a.stages).includes(stage) && split(a.moments).includes('stage_entered') && !a.competitor &&\n    (a.industries === 'any' || split(a.industries).includes(industry)));\n  const assets = fits.filter(a => a.status !== 'needs update').map(a => ({ assetId: a.assetId, title: a.title, talkTrack: a.talkTrack }));\n  const heldBack = fits.filter(a => a.status === 'needs update').map(a => ({ assetId: a.assetId, title: a.title, flaggedClaims: a.flaggedClaims }));\n  moments.push({ runDate, rep, tenureDays, dealId: o.Id, dealName: o.Name, accountName: (o.Account || {}).Name || '', industry,\n    amount: Number(o.Amount) || 0, fromStage: prev[o.Id], toStage: o.StageName, stage, notes: [o.Description, o.NextStep].filter(Boolean).join(' '),\n    exitCriteria: book.exitCriteria, checkQuestion: book.checkQuestion, rubric: JSON.parse(book.rubricJson), passMark: Number(book.passMark),\n    assets, heldBack, libraryStatus: Object.fromEntries(lib.map(a => [a.assetId, { title: a.title, status: a.status }])) });\n}\nreturn [{ json: { runDate, stats, moments, snapshotRows } }];\n"
      },
      "executeOnce": true
    },
    {
      "id": "1418b751-5d3f-4ae9-8caf-840e16134a7d",
      "name": "Split Snapshot Rows",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1900,
        300
      ],
      "parameters": {
        "mode": "runOnceForAllItems",
        "jsCode": "return $('Detect First-Time Stage Entries').first().json.snapshotRows.map(json => ({ json }));"
      }
    },
    {
      "id": "ff8be848-241c-4532-b029-b7fc80c55dee",
      "name": "Save Stage Snapshot",
      "type": "n8n-nodes-base.dataTable",
      "typeVersion": 1.1,
      "position": [
        2100,
        300
      ],
      "parameters": {
        "resource": "row",
        "operation": "upsert",
        "dataTableId": {
          "__rl": true,
          "mode": "id",
          "value": "mqMF5PcOECgVanaQ",
          "cachedResultName": "Coaching Stage Snapshot"
        },
        "matchType": "allConditions",
        "filters": {
          "conditions": [
            {
              "keyName": "dealId",
              "condition": "eq",
              "keyValue": "={{ $json.dealId }}"
            }
          ]
        },
        "columns": {
          "mappingMode": "autoMapInputData",
          "value": {}
        }
      }
    },
    {
      "id": "0b4b389f-06ad-412d-b1a7-a3e0fb48a016",
      "name": "Split Moments",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1900,
        450
      ],
      "parameters": {
        "mode": "runOnceForAllItems",
        "jsCode": "return $('Detect First-Time Stage Entries').first().json.moments.map(json => ({ json }));"
      }
    },
    {
      "id": "e40e80a1-6612-4e5f-a6cf-85186f090325",
      "name": "Brief Writer",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 3.1,
      "position": [
        300,
        450
      ],
      "parameters": {
        "promptType": "define",
        "text": "={{ JSON.stringify({ deal: { name: $json.dealName, account: $json.accountName, industry: $json.industry, amount: $json.amount, notes: $json.notes }, stage: $json.stage, exitCriteria: $json.exitCriteria, assets: $json.assets }, null, 1) }}",
        "hasOutputParser": true,
        "options": {
          "systemMessage": "You write a two-minute coaching brief for a newly hired account executive at Fortavault, Inc. (a fictional data protection company) whose deal has just entered a sales stage they have not worked before. You get the deal facts (name, account, industry, amount, CRM notes), the stage's exit criteria and the approved assets for this stage with their talk tracks.\n\nWrite 3 to 5 sentences, under 110 words, in the second person: what this stage is for, what done looks like on this specific deal, and which one or two of the listed assets to use first and why for this account. Use only the facts given. Do not invent people, names, dates, numbers, competitors, agreements or anything the customer said. Ignore any note that describes test or seed data. Do not mention assets that are not in the list, and do not repeat the exit criteria as a list. Plain sentences only: no markdown, no headers, no field or column names."
        }
      },
      "retryOnFail": true,
      "maxTries": 3,
      "waitBetweenTries": 2000
    },
    {
      "id": "f59562a5-3731-4ffd-843e-e2fd1e17b0ac",
      "name": "Claude Sonnet",
      "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
      "typeVersion": 1.3,
      "position": [
        100,
        450
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "claude-sonnet-4-6",
          "cachedResultName": "Claude Sonnet 4.6"
        },
        "options": {
          "temperature": 0.3
        }
      },
      "credentials": {
        "anthropicApi": {
          "id": "3d3ZiTi7BwnkFwqU",
          "name": "Anthropic account"
        }
      }
    },
    {
      "id": "62a76f7b-69e3-4e4a-92f5-d2af5e232db9",
      "name": "Brief Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.3,
      "position": [
        100,
        600
      ],
      "parameters": {
        "schemaType": "fromJson",
        "jsonSchemaExample": "{ \"brief\": \"three to five plain sentences\" }"
      }
    },
    {
      "id": "7593bc88-1364-4938-bb11-5fb5ffa3c4e4",
      "name": "Build Coaching Message",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        500,
        450
      ],
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "// Assemble the coaching message in code: deal facts, exit criteria and assets come from data; only the brief paragraph is Claude's.\nconst m = $('Split Moments').item.json;\nconst b = $json.output || {};\nconst safe = t => String(t || '').replace(/~/g, '≈');\nconst money = n => '$' + Math.round(n).toLocaleString('en-US');\nconst first = m.rep.split(' ')[0];\nlet text = ':mortar_board: *' + first + ', first deal into ' + m.stage + '*: ' + m.dealName + ' (' + m.accountName + ', ' + money(m.amount) + ')\\n' +\n  '_' + m.fromStage + ' → ' + m.toStage + ' · day ' + m.tenureDays + ' of ramp_\\n\\n' +\n  '*Two-minute brief*\\n' + safe(b.brief) + '\\n\\n' +\n  '*Done means*\\n' + m.exitCriteria.split(';').map(s => '• ' + s.trim()).join('\\n') + '\\n\\n' +\n  '*Use*\\n' + (m.assets.length ? m.assets.map(a => '• ' + a.assetId + ' ' + a.title + ': ' + safe(a.talkTrack)).join('\\n') : '• No current asset for this stage') +\n  (m.heldBack.length ? '\\n_Held back until updated: ' + m.heldBack.map(a => a.assetId + ' ' + a.title).join(', ') + ' (flagged by the Stale Content Auditor)._' : '') +\n  '\\n\\n*Quick check before your next call*\\n' + m.checkQuestion;\nif (text.length > 2900) text = text.slice(0, 2880) + '…';\nreturn { json: { ...m, briefText: text } };\n"
      }
    },
    {
      "id": "4d34514f-b60d-46c8-a68b-222207fe0e99",
      "name": "Ask Check Question",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.3,
      "position": [
        700,
        450
      ],
      "parameters": {
        "resource": "message",
        "operation": "sendAndWait",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "id",
          "value": "C0BQ3G96HL6",
          "cachedResultName": "general"
        },
        "message": "={{ $json.briefText }}",
        "responseType": "freeText",
        "options": {
          "limitWaitTime": {
            "values": {
              "limitType": "afterTimeInterval",
              "resumeAmount": 24,
              "resumeUnit": "hours"
            }
          },
          "appendAttribution": false,
          "messageButtonLabel": "Answer",
          "responseFormTitle": "Quick check",
          "responseFormDescription": "={{ $json.checkQuestion }}",
          "responseFormButtonLabel": "Send answer"
        }
      },
      "credentials": {
        "slackApi": {
          "id": "mv7TIi8kucFPqPg6",
          "name": "Slack account"
        }
      }
    },
    {
      "id": "4cf9902b-4e24-430f-a810-6c0338227cf7",
      "name": "Answer Grader",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 3.1,
      "position": [
        300,
        750
      ],
      "parameters": {
        "promptType": "define",
        "text": "={{ JSON.stringify({ question: $('Build Coaching Message').item.json.checkQuestion, rubric: $('Build Coaching Message').item.json.rubric.map(r => ({ id: r.id, point: r.point })), answer: ($json.data || {}).text || '' }, null, 1) }}",
        "hasOutputParser": true,
        "options": {
          "systemMessage": "You grade a sales rep's short written answer against a rubric. For each rubric point, decide whether the answer covers it. Covered means the answer itself states it. Do not give credit for intent you infer, for things the rep could plausibly know, or for vague phrases (for example 'I will handle pricing') that do not meet the point.\n\nWhen a point is covered, return evidence: the exact words from the answer that cover it, copied word for word (a phrase or clause, never paraphrased). When it is not covered, return covered false and an empty evidence string. Return every rubric id exactly once."
        }
      },
      "retryOnFail": true,
      "maxTries": 3,
      "waitBetweenTries": 2000
    },
    {
      "id": "4c1b8185-d9f7-4274-9a3a-15e730632a34",
      "name": "Claude Grader Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
      "typeVersion": 1.3,
      "position": [
        100,
        750
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "claude-sonnet-4-6",
          "cachedResultName": "Claude Sonnet 4.6"
        },
        "options": {
          "temperature": 0
        }
      },
      "credentials": {
        "anthropicApi": {
          "id": "3d3ZiTi7BwnkFwqU",
          "name": "Anthropic account"
        }
      }
    },
    {
      "id": "48d5ba12-d56f-47cc-a472-fdbf68bb16bb",
      "name": "Rubric Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.3,
      "position": [
        100,
        900
      ],
      "parameters": {
        "schemaType": "fromJson",
        "jsonSchemaExample": "{ \"points\": [{ \"id\": \"R1\", \"covered\": true, \"evidence\": \"exact words from the answer\" }] }"
      }
    },
    {
      "id": "a585a701-192b-4c39-a5b3-a508de4e1706",
      "name": "Score Answer",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        500,
        750
      ],
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "// Score the answer in code. Claude says which rubric points the answer covers and quotes the words that cover each;\n// a point only counts if that quote appears word for word in the rep's answer. Feedback is built from the rubric, not invented.\nconst m = $('Build Coaching Message').item.json;\nconst answer = String(($('Ask Check Question').item.json.data || {}).text || '').trim();\nconst out = $json.output || {};\nconst norm = s => String(s || '').replace(/[‘’]/g, \"'\").replace(/[“”]/g, '\"').replace(/\\s+/g, ' ').trim().toLowerCase();\nconst judged = {}; for (const p of (out.points || [])) judged[p.id] = p;\nconst rows = m.rubric.map(r => {\n  const j = judged[r.id] || {};\n  const ev = String(j.evidence || '').trim();\n  const verified = !!j.covered && ev.length >= 6 && norm(answer).includes(norm(ev));\n  return { ...r, covered: verified, evidence: verified ? ev : '', unsupported: !!j.covered && !verified };\n});\nconst got = rows.filter(r => r.covered).length, total = rows.length, passed = got >= m.passMark;\nconst safe = t => String(t || '').replace(/~/g, '≈');\nconst st = id => (m.libraryStatus[id] || {});\nconst fix = r => '• ' + r.point + ' → ' + r.asset + ' ' + (st(r.asset).title || '') + (st(r.asset).status === 'needs update' ? ' _(being updated; check with its owner)_' : '');\nconst text = (passed ? ':white_check_mark:' : ':large_yellow_circle:') + ' *' + m.rep + ' · ' + m.stage + ' check on ' + m.dealName + ': ' + got + ' of ' + total + '*' + (passed ? ' (passes)' : ' (pass mark ' + m.passMark + ')') + '\\n' +\n  rows.filter(r => r.covered).map(r => '• ✓ ' + r.point + ': “' + safe(r.evidence) + '”').join('\\n') +\n  (got < total ? '\\n\\n*Before the next call*\\n' + rows.filter(r => !r.covered).map(fix).join('\\n') : '') +\n  (rows.some(r => r.unsupported) ? '\\n_' + rows.filter(r => r.unsupported).length + ' point(s) not counted: the grader\\'s quote was not in the answer._' : '') +\n  (!answer ? '\\n_No answer received before the time limit._' : '');\nconst log = { runDate: m.runDate, rep: m.rep, tenureDays: m.tenureDays, dealId: m.dealId, dealName: m.dealName, stage: m.stage,\n  assetsSent: m.assets.map(a => a.assetId).join(', '), heldBack: m.heldBack.map(a => a.assetId).join(', '), question: m.checkQuestion, answer,\n  pointsCovered: got, pointsTotal: total, passed, covered: rows.filter(r => r.covered).map(r => r.id).join(', '), missed: rows.filter(r => !r.covered).map(r => r.id).join(', '), loggedAt: $now.toISO() };\nreturn { json: { feedbackText: text.slice(0, 2900), log } };\n"
      }
    },
    {
      "id": "8f740310-17fa-41b4-bb47-b52649ef2df6",
      "name": "Post Feedback to Slack",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.7,
      "position": [
        700,
        750
      ],
      "parameters": {
        "resource": "message",
        "operation": "post",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "id",
          "value": "C0BQ3G96HL6",
          "cachedResultName": "general"
        },
        "text": "={{ $json.feedbackText }}",
        "otherOptions": {
          "includeLinkToWorkflow": false
        }
      },
      "credentials": {
        "slackApi": {
          "id": "mv7TIi8kucFPqPg6",
          "name": "Slack account"
        }
      }
    },
    {
      "id": "7019a341-af11-46a6-a0cf-2c9b622072c8",
      "name": "Coaching Log Row",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        700,
        900
      ],
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "return { json: $('Score Answer').item.json.log };"
      }
    },
    {
      "id": "a96a16e7-cf0f-491c-9157-ad3ad234fae3",
      "name": "Log Coaching",
      "type": "n8n-nodes-base.dataTable",
      "typeVersion": 1.1,
      "position": [
        900,
        900
      ],
      "parameters": {
        "resource": "row",
        "operation": "insert",
        "dataTableId": {
          "__rl": true,
          "mode": "id",
          "value": "b7Gn2C5Lh0GdZYNb",
          "cachedResultName": "Coaching Log"
        },
        "columns": {
          "mappingMode": "autoMapInputData",
          "value": {}
        }
      }
    }
  ],
  "connections": {
    "Business-Hours Stage Check": {
      "main": [
        [
          {
            "node": "Get Open Opportunities",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Open Opportunities": {
      "main": [
        [
          {
            "node": "Get Deal Owners",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Deal Owners": {
      "main": [
        [
          {
            "node": "Get Rep Roster",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Rep Roster": {
      "main": [
        [
          {
            "node": "Get Stage Playbooks",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Stage Playbooks": {
      "main": [
        [
          {
            "node": "Get Content Library",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Content Library": {
      "main": [
        [
          {
            "node": "Get Coaching Snapshot",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Coaching Snapshot": {
      "main": [
        [
          {
            "node": "Get Coaching Log",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Coaching Log": {
      "main": [
        [
          {
            "node": "Detect First-Time Stage Entries",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Detect First-Time Stage Entries": {
      "main": [
        [
          {
            "node": "Split Snapshot Rows",
            "type": "main",
            "index": 0
          },
          {
            "node": "Split Moments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Snapshot Rows": {
      "main": [
        [
          {
            "node": "Save Stage Snapshot",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Moments": {
      "main": [
        [
          {
            "node": "Brief Writer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Brief Writer": {
      "main": [
        [
          {
            "node": "Build Coaching Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Claude Sonnet": {
      "ai_languageModel": [
        [
          {
            "node": "Brief Writer",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Brief Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Brief Writer",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Build Coaching Message": {
      "main": [
        [
          {
            "node": "Ask Check Question",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Ask Check Question": {
      "main": [
        [
          {
            "node": "Answer Grader",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Answer Grader": {
      "main": [
        [
          {
            "node": "Score Answer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Claude Grader Model": {
      "ai_languageModel": [
        [
          {
            "node": "Answer Grader",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Rubric Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Answer Grader",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Score Answer": {
      "main": [
        [
          {
            "node": "Post Feedback to Slack",
            "type": "main",
            "index": 0
          },
          {
            "node": "Coaching Log Row",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Coaching Log Row": {
      "main": [
        [
          {
            "node": "Log Coaching",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  }
}