{
  "name": "Wildverse Starter: Daily Niche Digest",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [{ "field": "cronExpression", "expression": "0 7 * * *" }]
        }
      },
      "id": "a1000000-0000-0000-0000-000000000001",
      "name": "Every morning 7:00",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [0, 0]
    },
    {
      "parameters": {
        "url": "https://wildverse.org/feed/",
        "options": {}
      },
      "id": "a1000000-0000-0000-0000-000000000002",
      "name": "Fetch niche RSS",
      "type": "n8n-nodes-base.rssFeedRead",
      "typeVersion": 1.1,
      "position": [220, 0],
      "notes": "Replace the URL with any RSS feed in your niche. Add more RSS nodes in parallel and merge them if you want multiple sources."
    },
    {
      "parameters": {
        "sortFieldsUi": {
          "sortField": [{ "fieldName": "isoDate", "order": "descending" }]
        }
      },
      "id": "a1000000-0000-0000-0000-000000000003",
      "name": "Newest first",
      "type": "n8n-nodes-base.sort",
      "typeVersion": 1,
      "position": [440, 0]
    },
    {
      "parameters": { "maxItems": 8 },
      "id": "a1000000-0000-0000-0000-000000000004",
      "name": "Keep top 8",
      "type": "n8n-nodes-base.limit",
      "typeVersion": 1,
      "position": [660, 0]
    },
    {
      "parameters": {
        "jsCode": "// Build one HTML digest from all incoming items.\n// This node runs ONCE and reads all items — note 'Run Once for All Items' mode.\nconst rows = $input.all().map(({ json }) => {\n  const title = json.title ?? 'Untitled';\n  const link = json.link ?? '#';\n  const snippet = (json.contentSnippet ?? '').slice(0, 180);\n  return `<li style=\"margin-bottom:12px\"><a href=\"${link}\"><strong>${title}</strong></a><br><span style=\"color:#555\">${snippet}…</span></li>`;\n});\n\nconst html = `\n  <h2>Your niche digest — ${new Date().toDateString()}</h2>\n  <ul style=\"padding-left:18px\">${rows.join('')}</ul>\n  <p style=\"color:#999;font-size:12px\">Built with the Wildverse starter workflow · wildverse.org</p>`;\n\nreturn [{ json: { subject: `Niche digest · ${new Date().toLocaleDateString()}`, html } }];"
      },
      "id": "a1000000-0000-0000-0000-000000000005",
      "name": "Format digest (one email)",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [880, 0]
    },
    {
      "parameters": {
        "fromEmail": "you@yourdomain.com",
        "toEmail": "you@yourdomain.com",
        "subject": "={{ $json.subject }}",
        "emailFormat": "html",
        "html": "={{ $json.html }}",
        "options": {}
      },
      "id": "a1000000-0000-0000-0000-000000000006",
      "name": "Send digest email",
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 2.1,
      "position": [1100, 0],
      "notes": "Create an SMTP credential when prompted (your email provider's SMTP settings), and set both addresses to yours."
    }
  ],
  "connections": {
    "Every morning 7:00": { "main": [[{ "node": "Fetch niche RSS", "type": "main", "index": 0 }]] },
    "Fetch niche RSS": { "main": [[{ "node": "Newest first", "type": "main", "index": 0 }]] },
    "Newest first": { "main": [[{ "node": "Keep top 8", "type": "main", "index": 0 }]] },
    "Keep top 8": { "main": [[{ "node": "Format digest (one email)", "type": "main", "index": 0 }]] },
    "Format digest (one email)": { "main": [[{ "node": "Send digest email", "type": "main", "index": 0 }]] }
  },
  "settings": { "executionOrder": "v1" },
  "pinData": {},
  "meta": { "templateCredsSetupCompleted": false }
}
