{
  "name": "Monday research brief with sources (Felo + n8n)",
  "nodes": [
    {
      "parameters": {
        "content": "## Monday research brief with sources (Felo)\nEvery Monday at 7:00 AM, Felo answers this week's questions from live web search, and you get one email with each answer and the links it used.\n\n**Before you test**\n1. Ask Felo: create a Bearer Auth credential with a key from openapi.felo.ai > API Keys > Create Key.\n2. Email the brief: connect your Google account and change the To address.\n3. Edit the questions in **This week's questions**.\n\nFelo's free account gets 200 credits a day. One search is about 15 credits, so three questions a week fit easily.\n\n**Free step-by-step lesson:** learn.ynteractive.com/modules/n8n-felo-research-brief",
        "height": 560,
        "width": 400,
        "color": 4
      },
      "id": "s0",
      "name": "Sticky Note: overview",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -480,
        -340
      ]
    },
    {
      "parameters": {
        "content": "### Add your Felo key\nPOST https://openapi.felo.ai/v2/chat\nAuthentication: Generic > Bearer Auth.\nBody: `{ \"query\": ... }`. Returns `data.answer` and `data.resources` (link, title, snippet). Runs once per question.",
        "height": 220,
        "width": 300,
        "color": 3
      },
      "id": "s1",
      "name": "Sticky Note: key",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        480,
        -280
      ]
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "weeks",
              "triggerAtDay": [
                1
              ],
              "triggerAtHour": 7
            }
          ]
        }
      },
      "id": "b1",
      "name": "Every Monday at 7am",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.3,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {
        "jsCode": "// One item per question. Felo answers each one with live web search and sources.\n// Edit, add or remove questions here.\nconst questions = [\n  'What changed this month in IRS rules or deadlines that affect US small businesses?',\n  'What do US bookkeeping firms charge for monthly bookkeeping for a small business in 2026?',\n  'What new AI features did QuickBooks Online and Xero announce in the last 30 days?',\n];\nreturn questions.map((question) => ({ json: { question } }));"
      },
      "id": "b2",
      "name": "This week's questions",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        272,
        0
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://openapi.felo.ai/v2/chat",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBearerAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={ \"query\": {{ JSON.stringify($json.question) }} }",
        "options": {}
      },
      "id": "b3",
      "name": "Ask Felo",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        528,
        0
      ]
    },
    {
      "parameters": {
        "jsCode": "// Felo returns { status, data: { answer, resources: [{ link, title, snippet }] } } for each question.\n// Pair each answer with its question and keep the first 3 sources, then build one HTML email.\nconst questions = $('This week\\'s questions').all().map((i) => i.json.question);\nconst esc = (s) => String(s || '').replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');\nconst sections = $input.all().map((item, i) => {\n  const d = item.json.data || {};\n  const sources = (d.resources || []).slice(0, 3)\n    .map((r) => `<li><a href=\"${esc(r.link)}\">${esc(r.title || r.link)}</a></li>`).join('');\n  const answer = esc(d.answer || 'No answer this week.').replace(/\\n+/g, '<br>');\n  return `<h3>${esc(questions[i])}</h3><p>${answer}</p><p><b>Sources</b></p><ul>${sources || '<li>No sources returned</li>'}</ul>`;\n});\nconst today = new Date().toISOString().slice(0, 10);\nreturn [{ json: { subject: `Monday research brief, ${today}`, html: `<p>Here is this week's brief. Check the sources before you act on anything.</p>${sections.join('<hr>')}` } }];"
      },
      "id": "b4",
      "name": "Build the brief",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        784,
        0
      ]
    },
    {
      "parameters": {
        "resource": "message",
        "operation": "send",
        "sendTo": "you@yourcompany.example",
        "subject": "={{ $json.subject }}",
        "emailType": "html",
        "message": "={{ $json.html }}",
        "options": {
          "appendAttribution": false
        }
      },
      "id": "b5",
      "name": "Email the brief",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.2,
      "position": [
        1040,
        0
      ]
    }
  ],
  "connections": {
    "Every Monday at 7am": {
      "main": [
        [
          {
            "node": "This week's questions",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "This week's questions": {
      "main": [
        [
          {
            "node": "Ask Felo",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Ask Felo": {
      "main": [
        [
          {
            "node": "Build the brief",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build the brief": {
      "main": [
        [
          {
            "node": "Email the brief",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "pinData": {}
}
