{
  "name": "Detect stock price anomalies & send news alerts with Marketstack, HackerNews & DeepL",
  "nodes": [
    {
      "id": "a69b05fc-16c6-4f68-bd14-717b647ad900",
      "name": "Daily Check",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -544,
        0
      ]
    },
    {
      "id": "7ab68dfb-380e-4880-a948-89ad068e7533",
      "name": "Get Stock Data",
      "type": "n8n-nodes-base.marketstack",
      "position": [
        -320,
        0
      ]
    },
    {
      "id": "e8b1795e-59dd-4c7a-9db0-78d3e3228b25",
      "name": "Calculate Deviation",
      "type": "n8n-nodes-base.code",
      "position": [
        -96,
        0
      ]
    },
    {
      "id": "5f5c9951-f936-495d-985f-7ae2108d2787",
      "name": "Is Anomaly? (status != \"normal\")",
      "type": "n8n-nodes-base.if",
      "position": [
        128,
        0
      ]
    },
    {
      "id": "830c1c3b-92d7-42c2-a698-ec213787ace9",
      "name": "Get Related News",
      "type": "n8n-nodes-base.hackerNews",
      "position": [
        800,
        96
      ]
    },
    {
      "id": "31e2ca1d-9c30-4dbc-9a67-54e12ca974a3",
      "name": "Translate News",
      "type": "n8n-nodes-base.deepL",
      "position": [
        1248,
        32
      ]
    },
    {
      "id": "478fdb62-dde4-40e3-9e0b-2676330f91c0",
      "name": "Send Alert to Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        1696,
        96
      ]
    },
    {
      "id": "7ea2b37e-e074-400d-9e3b-28ac0bc9c816",
      "name": "Send Normal Report to Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        352,
        -96
      ]
    },
    {
      "id": "34c1613d-306b-47fa-b982-db156c54e053",
      "name": "Merge Original + Translated",
      "type": "n8n-nodes-base.merge",
      "position": [
        1472,
        96
      ]
    },
    {
      "id": "be7b89c0-99ac-44cb-aec0-03b844bc50f5",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -640,
        -224
      ],
      "parameters": {
        "width": 224,
        "height": 192,
        "content": "## Daily Check (09:00 JST)\n\nStarts the workflow every morning at 09:00 JST. Adjust schedule/timezone as needed."
      }
    },
    {
      "id": "2ea66681-b507-4737-a6f4-0d0c2590646f",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -400,
        208
      ],
      "parameters": {
        "width": null,
        "height": 192,
        "content": "## Get Stock Data (Marketstack)\nRetrieves the latest EOD prices for the configured ticker. Edit symbol and date range. Keep the limit ≥ 20 for a stable mean/σ."
      }
    },
    {
      "id": "e85baa53-b0ed-4017-98b0-e7a07a88c7aa",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1472,
        304
      ],
      "parameters": {
        "width": 624,
        "height": 256,
        "content": "## Customization Tips\n\n- Monitor multiple tickers: duplicate **Get Stock Data** and merge results.\n- Replace Hacker News with **NewsAPI** / **Google News RSS** for broader coverage.\n- Switch Slack to "
      }
    },
    {
      "id": "22cad535-6c1f-44c1-9018-910baa276cba",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -112,
        496
      ],
      "parameters": {
        "width": 400,
        "height": 384,
        "content": "## Node Structure Overview\n\nFlow:\n🕘 Daily Check (09:00) \n → 📊 Get Stock Data (Marketstack)\n → 🧮 Calculate Deviation (±2σ)\n → 🔀 IF: Is Anomaly? (status != \"normal\")\n\nTrue (Anomaly):\n  → 📰 Get Related N"
      }
    },
    {
      "id": "fa231074-0537-4cc6-b33c-e90006605377",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        320,
        352
      ],
      "parameters": {
        "width": null,
        "height": 176,
        "content": "## Send Normal Report to Slack\n\nSends a concise “no anomaly” message with basic stats.\n"
      }
    },
    {
      "id": "2c8bbc35-0320-4350-b64f-e58eacd7c974",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -320,
        -448
      ],
      "parameters": {
        "width": 304,
        "height": 272,
        "content": "## 🛠️ Setup Instructions\n\n1. Connect your **Marketstack**, **DeepL**, and **Slack** credentials.\n2. Update ticker symbol inside “Get Stock Data”.\n3. Customize Slack channel in both Slack nodes.\n4. Mod"
      }
    },
    {
      "id": "7fbb2805-1ffd-4ce6-86a6-04d9ba827191",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1184,
        -288
      ],
      "parameters": {
        "width": 480,
        "height": 816,
        "content": "## Price Anomaly Detection & News Alert (Marketstack + HN + DeepL + Slack)\n\n## Overview\nThis workflow monitors a stock’s closing price via **Marketstack**. It computes a **20-day moving average** and "
      }
    },
    {
      "id": "4a60a88c-3f9d-4919-9f8e-769138eebad2",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -192,
        -160
      ],
      "parameters": {
        "width": 256,
        "height": null,
        "content": "## Calculate Deviation\n\nComputes 20-day mean and standard deviation; classifies the latest close as normal, high (+2σ), or low (−2σ)."
      }
    },
    {
      "id": "d3e597a0-0400-400d-970d-f179bf3c574c",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        32,
        176
      ],
      "parameters": {
        "width": 256,
        "height": 176,
        "content": "## Is Anomaly? (status != \"normal\")\n\nBranches to the news path only when the latest close exceeds ±2σ."
      }
    },
    {
      "id": "cb2c48c9-349d-4c3e-9f17-ed4636ca0b82",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        720,
        288
      ],
      "parameters": {
        "width": 256,
        "height": 176,
        "content": "## Get Related News (Hacker News)\n\nSearches articles by the ticker/company keyword. You can switch to NewsAPI/Google RSS."
      }
    },
    {
      "id": "8a824d8c-3d66-4838-9c5e-a8708afcfa1d",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        944,
        -208
      ],
      "parameters": {
        "width": 256,
        "height": 176,
        "content": "## Format News (Title + Summary + URL)\n\nCleans HTML (e.g., <em>) and formats top items for translation/Slack."
      }
    },
    {
      "id": "1ef7949a-e396-449a-b21c-4e72e7031c38",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1232,
        -208
      ],
      "parameters": {
        "width": 208,
        "height": 176,
        "content": "## Translate News (EN → JA)\n\nDeepL translation to Japanese. Change target_lang if needed."
      }
    },
    {
      "id": "4a410b17-9763-4723-a5f2-61fb6ab50fd7",
      "name": "Sticky Note12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1504,
        -208
      ],
      "parameters": {
        "width": 208,
        "height": 176,
        "content": "## Merge Original + Translated\n\nAppends original English and translated Japanese into one message payload."
      }
    },
    {
      "id": "0d5d6b48-6983-4136-80e3-0cf9de926972",
      "name": "Sticky Note13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1744,
        -208
      ],
      "parameters": {
        "width": 208,
        "height": 176,
        "content": "## Send Alert to Slack (Anomaly)\n\nSends bilingual alert with stats (latest, mean, σ) and related news."
      }
    },
    {
      "id": "fe474a5c-9358-4f1b-ad07-b2ae6169c280",
      "name": "Add Symbol Field",
      "type": "n8n-nodes-base.set",
      "position": [
        352,
        96
      ]
    },
    {
      "id": "ad957b08-b108-427e-9843-b48be879cb3b",
      "name": "Compose Slack Message",
      "type": "n8n-nodes-base.code",
      "position": [
        1024,
        96
      ]
    },
    {
      "id": "a5ecf56c-8e7d-42da-9335-a2b1a08b71a1",
      "name": "Build News Keyword",
      "type": "n8n-nodes-base.code",
      "position": [
        576,
        96
      ]
    }
  ],
  "connections": {
    "Daily Check": {
      "main": [
        [
          {
            "node": "Get Stock Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Stock Data": {
      "main": [
        [
          {
            "node": "Calculate Deviation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Translate News": {
      "main": [
        [
          {
            "node": "Merge Original + Translated",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Symbol Field": {
      "main": [
        [
          {
            "node": "Build News Keyword",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Related News": {
      "main": [
        [
          {
            "node": "Compose Slack Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build News Keyword": {
      "main": [
        [
          {
            "node": "Get Related News",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate Deviation": {
      "main": [
        [
          {
            "node": "Is Anomaly? (status != \"normal\")",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Alert to Slack": {
      "main": [
        []
      ]
    },
    "Compose Slack Message": {
      "main": [
        [
          {
            "node": "Translate News",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge Original + Translated",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Merge Original + Translated": {
      "main": [
        [
          {
            "node": "Send Alert to Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Anomaly? (status != \"normal\")": {
      "main": [
        [
          {
            "node": "Add Symbol Field",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Normal Report to Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}