{
  "name": "Building block: every morning, fetch + format + send",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 8 * * *"
            }
          ]
        }
      },
      "id": "b1b2c3d4-0001-4000-8000-000000000001",
      "name": "Every day 08:00",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [0, 0]
    },
    {
      "parameters": {
        "url": "https://api.open-meteo.com/v1/forecast?latitude=59.44&longitude=24.75&daily=temperature_2m_max,precipitation_sum&timezone=Europe%2FTallinn&forecast_days=1",
        "options": {}
      },
      "id": "b1b2c3d4-0002-4000-8000-000000000002",
      "name": "HTTP Request (any open API)",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [240, 0],
      "notes": "Replace the URL with whatever your app needs: weather, news, prices, your own Supabase table. No key needed for this example."
    },
    {
      "parameters": {
        "jsCode": "const d = $input.first().json.daily;\nconst text = `Tallinn today: max ${d.temperature_2m_max[0]} C, rain ${d.precipitation_sum[0]} mm.`;\nreturn [{ json: { text } }];"
      },
      "id": "b1b2c3d4-0003-4000-8000-000000000003",
      "name": "Format (Code)",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [480, 0],
      "notes": "Three lines of JavaScript. Change the sentence, keep the shape: return [{ json: { text } }]."
    },
    {
      "parameters": {
        "sendTo": "you@example.com",
        "subject": "Morning digest",
        "message": "={{ $json.text }}",
        "options": {}
      },
      "id": "b1b2c3d4-0004-4000-8000-000000000004",
      "name": "Gmail (send)",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.1,
      "position": [720, 0],
      "notes": "Connect your Gmail once under Credentials (OAuth, two clicks). Or swap this node for Telegram, Slack, Discord: same input, field 'text'."
    }
  ],
  "connections": {
    "Every day 08:00": { "main": [[{ "node": "HTTP Request (any open API)", "type": "main", "index": 0 }]] },
    "HTTP Request (any open API)": { "main": [[{ "node": "Format (Code)", "type": "main", "index": 0 }]] },
    "Format (Code)": { "main": [[{ "node": "Gmail (send)", "type": "main", "index": 0 }]] }
  },
  "settings": { "executionOrder": "v1" },
  "pinData": {},
  "meta": { "instanceId": "vibesprint-2026" }
}
