{
  "id": "founder-notes-workflow-001",
  "name": "Agnic #001 — Founder Weekly Insight Generator (No APIs)",
  "nodes": [
    {
      "parameters": {},
      "id": "f2d7d1e2-7d2d-4c0b-a40a-7a8c0b0a9a01",
      "name": "Manual Trigger",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        260,
        260
      ]
    },
    {
      "parameters": {
        "assignments": {
          "assignment": [
            {
              "id": "e2f1a3b4-1111-4444-8888-000000000001",
              "name": "week_ending",
              "value": "={{$now.toISODate()}}",
              "type": "string"
            },
            {
              "id": "e2f1a3b4-2222-4444-8888-000000000002",
              "name": "founder_name",
              "value": "Alex",
              "type": "string"
            },
            {
              "id": "e2f1a3b4-3333-4444-8888-000000000003",
              "name": "product_name",
              "value": "Agnic.AI",
              "type": "string"
            },
            {
              "id": "e2f1a3b4-4444-4444-8888-000000000004",
              "name": "raw_notes",
              "value": "- Shipped auth refactor\n- Customer asked for feature X (said no)\n- Infra cost higher than expected\n- Felt distracted mid-week\n- Good call not rushing launch\n- Fixed flaky test suite\n- Helped a user unblock onboarding",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "a3b1d2c3-1111-4b22-8c33-444455556666",
      "name": "Set Weekly Notes",
      "type": "n8n-nodes-base.set",
      "typeVersion": 2,
      "position": [
        500,
        260
      ]
    },
    {
      "parameters": {
        "jsCode": "const raw = ($json.raw_notes || '').toString();\n\n// Split into lines, normalize bullets, trim\nconst lines = raw\n  .split(/\\r?\\n/)\n  .map(l => l.trim())\n  .filter(Boolean)\n  .map(l => l.replace(/^[-*•]\\s*/, ''))\n  .filter(Boolean);\n\n// Simple categorization heuristics\nconst buckets = {\n  shipped: [],\n  decisions: [],\n  learnings: [],\n  challenges: [],\n  community: [],\n  misc: []\n};\n\nconst decisionWords = /(decid|said no|chose|trade-?off|priorit|won't|will not|kill|cut|drop)/i;\nconst shippedWords = /(ship|shipped|release|launched|deploy|refactor|implemented|built|fixed|improved)/i;\nconst learningWords = /(learn|realiz|insight|noticed|found that|understood)/i;\nconst challengeWords = /(bug|incident|down|broke|blocked|stuck|delay|cost|expensive|flaky|distract|risk)/i;\nconst communityWords = /(customer|user|community|feedback|support|onboarding|request)/i;\n\nfor (const t of lines) {\n  if (decisionWords.test(t)) buckets.decisions.push(t);\n  else if (shippedWords.test(t)) buckets.shipped.push(t);\n  else if (learningWords.test(t)) buckets.learnings.push(t);\n  else if (challengeWords.test(t)) buckets.challenges.push(t);\n  else if (communityWords.test(t)) buckets.community.push(t);\n  else buckets.misc.push(t);\n}\n\n// Helper to cap list length\nconst take = (arr, n) => arr.slice(0, n);\n\n// Build a grounded “one insight” from decisions/challenges if possible\nlet insight = '';\nif (buckets.decisions.length) {\n  insight = `This week reinforced that momentum comes from *subtraction* as much as shipping — making a clear call (${buckets.decisions[0]}) reduced ambiguity and helped execution.`;\n} else if (buckets.challenges.length) {\n  insight = `This week reminded me that reliability and focus are features too — addressing friction early (${buckets.challenges[0]}) pays compounding dividends.`;\n} else if (buckets.shipped.length) {\n  insight = `This week validated that small, concrete improvements compound — getting (${buckets.shipped[0]}) done created room for faster iteration.`;\n} else {\n  insight = `This week was a reminder to capture decisions as they happen — the work is real, but the *signal* comes from reflecting on it.`;\n}\n\n// Post hooks\nconst hooks = [];\nif (buckets.decisions[0]) hooks.push(`A decision I made this week: ${buckets.decisions[0]}`);\nif (buckets.shipped[0]) hooks.push(`What I shipped this week: ${buckets.shipped[0]}`);\nif (buckets.challenges[0]) hooks.push(`A problem that surprised me: ${buckets.challenges[0]}`);\nif (hooks.length === 0) hooks.push('One thing I learned this week building.');\n\nconst founder = ($json.founder_name || 'Founder').toString();\nconst product = ($json.product_name || 'my product').toString();\nconst weekEnding = ($json.week_ending || '').toString();\n\nconst md = `# Weekly Insight — Week ending ${weekEnding}\\n\\n**Builder:** ${founder}\\n**Product:** ${product}\\n\\n## What happened this week\\n${take([...buckets.shipped, ...buckets.community, ...buckets.misc], 6).map(x => `- ${x}`).join('\\n') || '- (Add your notes)'}\\n\\n## Key decisions & trade-offs\\n${(take(buckets.decisions, 4).map(x => `- ${x}`).join('\\n')) || '- (No major decisions captured this week — add one if there was a meaningful trade-off.)'}\\n\\n## Challenges / risks\\n${(take(buckets.challenges, 4).map(x => `- ${x}`).join('\\n')) || '- (No notable challenges captured — add any friction that slowed you down.)'}\\n\\n## One insight worth sharing\\n${insight}\\n\\n## Optional post hooks\\n${hooks.map(h => `- ${h}`).join('\\n')}\\n`;\n\nreturn [{\n  json: {\n    week_ending: weekEnding,\n    founder_name: founder,\n    product_name: product,\n    normalized_notes: lines,\n    buckets,\n    insight,\n    hooks,\n    markdown_draft: md\n  }\n}];"
      },
      "id": "b9c8d7e6-2222-4d33-9e44-777788889999",
      "name": "Normalize + Generate Draft",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        760,
        260
      ]
    },
    {
      "parameters": {
        "assignments": {
          "assignment": [
            {
              "id": "f3a2d1c4-1111-4444-9999-000000000001",
              "name": "title",
              "value": "={{'Weekly Insight — Week ending ' + $json.week_ending}}",
              "type": "string"
            },
            {
              "id": "f3a2d1c4-2222-4444-9999-000000000002",
              "name": "markdown_draft",
              "value": "={{$json.markdown_draft}}",
              "type": "string"
            },
            {
              "id": "f3a2d1c4-3333-4444-9999-000000000003",
              "name": "buckets",
              "value": "={{$json.buckets}}",
              "type": "object"
            }
          ]
        },
        "options": {}
      },
      "id": "c0ffee00-3333-4e44-8f55-aaaaaaaaaaaa",
      "name": "Prepare Output",
      "type": "n8n-nodes-base.set",
      "typeVersion": 2,
      "position": [
        1020,
        260
      ]
    }
  ],
  "connections": {
    "Manual Trigger": {
      "main": [
        [
          {
            "node": "Set Weekly Notes",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Weekly Notes": {
      "main": [
        [
          {
            "node": "Normalize + Generate Draft",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Normalize + Generate Draft": {
      "main": [
        [
          {
            "node": "Prepare Output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "versionId": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
  "settings": {
    "executionTimeout": 360,
    "saveManualExecutions": true
  },
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "pinData": {}
}