{
  "id": "demo7191f44f2eb6",
  "name": "Meeting-to-Action \u2014 Local Demo",
  "active": false,
  "nodes": [
    {
      "id": "start",
      "name": "Run local demo",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        50,
        220
      ],
      "parameters": {}
    },
    {
      "id": "fixtures",
      "name": "Load fictional scenarios",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        280,
        220
      ],
      "parameters": {
        "jsCode": "return [{\"json\": {\"name\": \"Explicit action produces a task preview\", \"input\": {\"transcript\": \"ACTION | Mira | 2026-10-10 | Review onboarding copy\", \"members\": [\"Mira\"], \"today\": \"2026-10-01\"}, \"expected\": {\"ready\": 1, \"review\": 0, \"externalTasksCreated\": 0}}}, {\"json\": {\"name\": \"Unknown owner needs review\", \"input\": {\"transcript\": \"ACTION | Unknown | 2026-10-10 | Review copy\", \"members\": [\"Mira\"], \"today\": \"2026-10-01\"}, \"expected\": {\"ready\": 0, \"review\": 1}}}, {\"json\": {\"name\": \"Impossible date needs review\", \"input\": {\"transcript\": \"ACTION | Mira | 2026-02-30 | Review copy\", \"members\": [\"Mira\"], \"today\": \"2026-10-01\"}, \"expected\": {\"ready\": 0, \"review\": 1}}}, {\"json\": {\"name\": \"Past due date needs review\", \"input\": {\"transcript\": \"ACTION | Mira | 2026-09-30 | Review copy\", \"members\": [\"Mira\"], \"today\": \"2026-10-01\"}, \"expected\": {\"ready\": 0, \"review\": 1}}}, {\"json\": {\"name\": \"Duplicate action yields one preview\", \"input\": {\"transcript\": \"ACTION | Mira | 2026-10-10 | Review copy\\nACTION | Mira | 2026-10-10 | Review copy\", \"members\": [\"Mira\"], \"today\": \"2026-10-01\"}, \"expected\": {\"ready\": 1, \"duplicates\": 1}}}, {\"json\": {\"name\": \"Tentative commitment needs review\", \"input\": {\"transcript\": \"ACTION | Mira | 2026-10-10 | Maybe redesign onboarding\", \"members\": [\"Mira\"], \"today\": \"2026-10-01\"}, \"expected\": {\"ready\": 0, \"review\": 1}}}, {\"json\": {\"name\": \"Malformed action is retained for review\", \"input\": {\"transcript\": \"ACTION discuss design\", \"members\": [\"Mira\"], \"today\": \"2026-10-01\"}, \"expected\": {\"ready\": 0, \"review\": 1}}}, {\"json\": {\"name\": \"Ordinary discussion does not invent tasks\", \"input\": {\"transcript\": \"We discussed onboarding. No actions were assigned.\", \"members\": [\"Mira\"], \"today\": \"2026-10-01\"}, \"expected\": {\"ready\": 0, \"review\": 0}}}];"
      }
    },
    {
      "id": "stage0",
      "name": "Parse action-line fixtures",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        570,
        220
      ],
      "parameters": {
        "jsCode": "function step({input}) {\n const lines=input.transcript.split('\\n').map(s=>s.trim()).filter(Boolean);\n return {actions:lines.filter(s=>s.startsWith('ACTION')).map(line=>{const p=line.split('|').map(s=>s.trim());return p.length===4&&p[0]==='ACTION'?{owner:p[1],due:p[2],title:p[3]}:{invalid:true,raw:line};})};\n}\nreturn $input.all().map(({json},index)=>({json:{...json,...step(json)},pairedItem:{item:index}}));"
      }
    },
    {
      "id": "stage1",
      "name": "Validate owners dates and duplicates",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        820,
        340
      ],
      "parameters": {
        "jsCode": "function step({input,actions}) {\n const ready=[],review=[],seen=new Set();let duplicates=0;\n for(const a of actions){if(a.invalid){review.push({reason:'malformed-action'});continue;}\n const key=JSON.stringify([a.owner.toLowerCase(),a.due,a.title.toLowerCase()]);if(seen.has(key)){duplicates++;continue;}seen.add(key);\n const date=new Date(a.due+'T00:00:00Z');const validDate=/^\\d{4}-\\d{2}-\\d{2}$/.test(a.due)&&!Number.isNaN(date.getTime())&&date.toISOString().slice(0,10)===a.due;\n if(!(input.members??[]).includes(a.owner)||!validDate||a.due<input.today||!a.title||/maybe|possibly|tbd/i.test(a.title)){review.push({...a,reason:'ambiguous-or-invalid'});continue;}ready.push(a);\n }\n return {ready,review,duplicates};\n}\nreturn $input.all().map(({json},index)=>({json:{...json,...step(json)},pairedItem:{item:index}}));"
      }
    },
    {
      "id": "stage2",
      "name": "Prepare project task previews",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1110,
        220
      ],
      "parameters": {
        "jsCode": "function step({ready,review,duplicates}) {\n return {result:{ready:ready.length,review:review.length,duplicates,tasks:ready.map(a=>({...a,destination:'demo-project',created:false})),externalTasksCreated:0}};\n}\nreturn $input.all().map(({json},index)=>({json:{...json,...step(json)},pairedItem:{item:index}}));"
      }
    },
    {
      "id": "assert",
      "name": "Verify expected outcomes",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1370,
        220
      ],
      "parameters": {
        "jsCode": "const checks=$input.all().map(({json})=>{const failed=Object.entries(json.expected).filter(([k,v])=>JSON.stringify(json.result[k])!==JSON.stringify(v));return {scenario:json.name,passed:failed.length===0,expected:json.expected,output:json.result,failures:failed.map(([k])=>k)};});\nconst failures=checks.filter(c=>!c.passed);if(failures.length)throw new Error(JSON.stringify(failures));\nreturn [{json:{demo:\"meeting-to-action\",mode:'local-simulation',checkedAt:new Date().toISOString(),passed:checks.length,failed:0,externalActionsPerformed:0,checks}}];"
      }
    },
    {
      "id": "section-1",
      "name": "Section 1",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        0,
        0
      ],
      "parameters": {
        "width": 480,
        "height": 420,
        "color": 7,
        "content": "### 1. Load meeting notes\n\nUse structured fictional ACTION lines with owners, due dates, and task descriptions, plus malformed and ambiguous cases."
      }
    },
    {
      "id": "section-2",
      "name": "Section 2",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        520,
        0
      ],
      "parameters": {
        "width": 520,
        "height": 550,
        "color": 7,
        "content": "### 2. Parse and validate actions\n\nExtract explicit action lines, check team membership and calendar dates, and remove duplicate tasks."
      }
    },
    {
      "id": "section-3",
      "name": "Section 3",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        1080,
        0
      ],
      "parameters": {
        "width": 510,
        "height": 420,
        "color": 7,
        "content": "### 3. Preview project tasks\n\nSeparate task previews from items needing review, then verify each scenario. No transcription model or project-management API is called."
      }
    }
  ],
  "connections": {
    "Run local demo": {
      "main": [
        [
          {
            "node": "Load fictional scenarios",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Load fictional scenarios": {
      "main": [
        [
          {
            "node": "Parse action-line fixtures",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse action-line fixtures": {
      "main": [
        [
          {
            "node": "Validate owners dates and duplicates",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate owners dates and duplicates": {
      "main": [
        [
          {
            "node": "Prepare project task previews",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare project task previews": {
      "main": [
        [
          {
            "node": "Verify expected outcomes",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "pinData": {}
}
