{
  "name": "Send high-impact US economic calendar alerts to Slack with SiftingIO",
  "nodes": [
    {
      "parameters": {
        "content": "## High-impact US economic calendar \u2014 SiftingIO \u2192 Slack\n\nEvery morning this workflow pulls the next 48 hours of **high-impact US economic events** and posts a compact digest to Slack.\n\n### Setup (about 3 minutes)\n1. Install `n8n-nodes-siftingio`\n2. Create a free API key:\n   https://sifting.io/register?utm_source=n8n&utm_medium=workflow_template&utm_campaign=economic_calendar_slack\n3. Select your SiftingIO credential on **Get high-impact US events**\n4. Open **Post digest to Slack**, connect Slack, and choose your channel\n5. Click **Execute workflow** once, then activate it\n\nYou can edit the SiftingIO node to change impact, agency, country, date range, or event ID.\n\nThe workflow imports inactive and contains no credentials or secrets.",
        "height": 610,
        "width": 460
      },
      "id": "a1c44ed7-e149-4c03-aa49-66ce2eb9dd0a",
      "name": "Setup guide",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -760,
        -140
      ]
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 6
            }
          ]
        }
      },
      "id": "46e10f06-c2bd-45f8-8971-caacf6e6dc5a",
      "name": "Every morning at 6am",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        -220,
        120
      ]
    },
    {
      "parameters": {
        "resource": "economicCalendar",
        "operation": "list",
        "from": "={{ $now.toISODate() }}",
        "to": "={{ $now.plus({ days: 2 }).toISODate() }}",
        "country": "US",
        "impact": "high",
        "agency": "",
        "event_id": "",
        "limit": 50
      },
      "id": "a6b465e5-be3f-4027-8090-fa6d90d00f48",
      "name": "Get high-impact US events",
      "type": "n8n-nodes-siftingio.siftingIo",
      "typeVersion": 1,
      "position": [
        60,
        120
      ]
    },
    {
      "parameters": {
        "jsCode": "const events = $input.all().map((item) => item.json);\n\nfunction first(...values) {\n  return values.find((value) => value !== undefined && value !== null && value !== '');\n}\n\nconst sorted = events.sort((a, b) => {\n  const ta = Date.parse(first(a.scheduled_at, a.datetime, a.date, ''));\n  const tb = Date.parse(first(b.scheduled_at, b.datetime, b.date, ''));\n  return (Number.isFinite(ta) ? ta : 0) - (Number.isFinite(tb) ? tb : 0);\n});\n\nconst lines = [\n  `*High-impact US economic calendar*`,\n  `Next 48 hours \u00b7 generated ${new Date().toISOString().replace('T', ' ').slice(0, 16)} UTC`,\n  ''\n];\n\nif (sorted.length === 0) {\n  lines.push('No high-impact US releases found in the next 48 hours.');\n} else {\n  for (const event of sorted) {\n    const name = first(event.name, event.title, event.event_name, event.event_id, 'Economic event');\n    const agency = first(event.agency, event.source, '');\n    const scheduled = first(event.scheduled_at, event.datetime, event.date);\n    const when = scheduled\n      ? new Date(scheduled).toISOString().replace('T', ' ').slice(0, 16) + ' UTC'\n      : 'Time TBA';\n    const consensus = first(event.consensus, event.forecast);\n    const previous = first(event.previous, event.prior);\n\n    let detail = `\u2022 *${name}*${agency ? ` (${agency})` : ''} \u2014 ${when}`;\n    if (consensus !== undefined) detail += `\\n  Consensus: ${consensus}`;\n    if (previous !== undefined) detail += `${consensus !== undefined ? ' \u00b7' : '\\n '} Previous: ${previous}`;\n    lines.push(detail);\n  }\n}\n\nlines.push('', 'Data: SiftingIO \u00b7 https://sifting.io/docs');\nreturn [{ json: { message: lines.join('\\n') } }];"
      },
      "id": "4c114f03-ce56-426a-95c6-ae4700b246b9",
      "name": "Format Slack digest",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        340,
        120
      ]
    },
    {
      "parameters": {
        "resource": "message",
        "operation": "post",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "value": "#market-briefing",
          "mode": "name"
        },
        "text": "={{ $json.message }}",
        "otherOptions": {}
      },
      "id": "311b081e-02f2-4f31-a47e-c6981e8ada3e",
      "name": "Post digest to Slack",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.3,
      "position": [
        600,
        120
      ],
      "retryOnFail": true,
      "maxTries": 3,
      "waitBetweenTries": 1000
    }
  ],
  "connections": {
    "Every morning at 6am": {
      "main": [
        [
          {
            "node": "Get high-impact US events",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get high-impact US events": {
      "main": [
        [
          {
            "node": "Format Slack digest",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Slack digest": {
      "main": [
        [
          {
            "node": "Post digest to Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1",
    "timezone": "UTC"
  },
  "active": false
}