{
  "name": "FilingPulse — daily 8-K corporate events digest",
  "nodes": [
    {
      "parameters": {
        "content": "## FilingPulse → daily 8-K digest\n\nOnce a day, fetches the last 24 hours of 8-K corporate event filings (earnings releases, executive changes, M&A, bankruptcies — classified by SEC item number) and posts a one-message digest.\n\n**Setup (2 minutes):**\n1. Get a free API key at https://filingpulse.io/signup.html\n2. Paste it into the **Fetch 8-K events** node (X-API-Key header).\n3. Paste your Slack incoming-webhook URL into the **Send digest** node. For Discord, change the body to `{\"content\": ...}`.\n4. Adjust the trigger time if you like (times run in your n8n instance's timezone), then activate.\n\nItem code meanings (2.02 = earnings, 5.02 = officer/director changes, 1.01 = material agreements, …): https://filingpulse.io/docs.html#schema\nFilter server-side instead with `item=2.02` on the fetch node's query parameters.",
        "height": 520,
        "width": 460
      },
      "id": "sticky-setup-digest",
      "name": "Setup",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [-260, 120]
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "days",
              "triggerAtHour": 18,
              "triggerAtMinute": 30
            }
          ]
        }
      },
      "id": "schedule-daily",
      "name": "Daily at 18:30",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [260, 300]
    },
    {
      "parameters": {
        "url": "https://api.filingpulse.io/v1/events",
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "since",
              "value": "={{ $now.minus({ days: 1 }).toFormat('yyyy-MM-dd') }}"
            },
            {
              "name": "limit",
              "value": "100"
            }
          ]
        },
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "X-API-Key",
              "value": "PASTE_YOUR_FREE_KEY"
            }
          ]
        },
        "options": {}
      },
      "id": "fetch-8k",
      "name": "Fetch 8-K events",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [480, 300]
    },
    {
      "parameters": {
        "jsCode": "// Build one factual digest message — counts by item code plus a sample of filings.\nconst rows = $json.data || [];\nif (!rows.length) {\n  return [{ json: { text: 'FilingPulse 8-K digest: no 8-K events in the window.' } }];\n}\nconst byItem = {};\nfor (const e of rows) {\n  for (const i of (e.items || [])) {\n    byItem[i.code] = (byItem[i.code] || 0) + 1;\n  }\n}\nconst counts = Object.entries(byItem)\n  .sort((a, b) => b[1] - a[1])\n  .map(([code, n]) => code + ' \\u00d7' + n)\n  .join(', ');\nconst lines = rows.slice(0, 15).map(e =>\n  '\\u2022 ' + ((e.issuer && e.issuer.name) || '?') + ' \\u2014 items ' +\n  (e.items || []).map(i => i.code).join(', ') + ' (' + (e.filed_date || '?') + ')');\nconst capped = rows.length >= 100 ? ' \\u2014 first 100 only, raise limit for more' : '';\nconst more = rows.length > 15 ? '\\n\\u2026and ' + (rows.length - 15) + ' more.' : '';\nconst text = 'FilingPulse 8-K digest \\u2014 ' + rows.length + ' filings since yesterday' + capped +\n             '\\nItem counts: ' + counts + '\\n' + lines.join('\\n') + more;\nreturn [{ json: { text } }];"
      },
      "id": "build-digest",
      "name": "Build digest",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [700, 300]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://hooks.slack.com/services/REPLACE/WITH/YOURS",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ text: $json.text }) }}",
        "options": {}
      },
      "id": "send-digest",
      "name": "Send digest",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [920, 300]
    }
  ],
  "connections": {
    "Daily at 18:30": {
      "main": [[{ "node": "Fetch 8-K events", "type": "main", "index": 0 }]]
    },
    "Fetch 8-K events": {
      "main": [[{ "node": "Build digest", "type": "main", "index": 0 }]]
    },
    "Build digest": {
      "main": [[{ "node": "Send digest", "type": "main", "index": 0 }]]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "pinData": {}
}
