{
  "id": "dBu8e67SpohXJlPj",
  "meta": {
    "builderVariant": "mcp",
    "aiBuilderAssisted": true
  },
  "name": "Combine weather, news and your tasks into one AI morning briefing with Gemini",
  "tags": [],
  "nodes": [
    {
      "id": "b2bea951-4f50-42e8-8cd0-c9da21737dbe",
      "name": "Schedule Every Morning",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -32,
        208
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 6,
              "triggerAtMinute": 30
            }
          ]
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "afd0441c-ab82-4235-a4b6-4264c51fcbfd",
      "name": "Read News Feed",
      "type": "n8n-nodes-base.rssFeedRead",
      "position": [
        304,
        208
      ],
      "parameters": {
        "url": "https://feeds.bbci.co.uk/news/rss.xml",
        "options": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "ecd93035-77da-4ea4-a893-74831d76750f",
      "name": "Take Top Headlines",
      "type": "n8n-nodes-base.code",
      "position": [
        528,
        208
      ],
      "parameters": {
        "jsCode": "const items = $input.all().slice(0, 6).map(function (i) { return '- ' + (i.json.title || ''); });\nreturn [{ json: { source: 'news', headlines: items.join('\\n') } }];"
      },
      "typeVersion": 2
    },
    {
      "id": "4f72ebe1-1a2e-4089-9495-87b5927bb128",
      "name": "Combine All Sources",
      "type": "n8n-nodes-base.merge",
      "position": [
        848,
        224
      ],
      "parameters": {
        "numberInputs": 3
      },
      "typeVersion": 3.2
    },
    {
      "id": "fe735c40-04ae-4e72-b484-3a18d4305c98",
      "name": "Get Today Tasks",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        304,
        368
      ],
      "parameters": {
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "",
          "cachedResultName": "Tasks"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "",
          "cachedResultName": "Select your spreadsheet"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "8bc983a8-3f5c-4fa0-a7be-bff21f4da4f6",
      "name": "List Open Tasks",
      "type": "n8n-nodes-base.code",
      "position": [
        528,
        368
      ],
      "parameters": {
        "jsCode": "const items = $input.all().map(function (i) { return '- [' + (i.json.Priority || 'Normal') + '] ' + (i.json.Task || ''); });\nreturn [{ json: { source: 'tasks', tasks: items.join('\\n'), openCount: items.length } }];"
      },
      "typeVersion": 2
    },
    {
      "id": "40807524-1267-4ab3-9856-5d6776a519cb",
      "name": "Get Weather",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        304,
        544
      ],
      "parameters": {
        "url": "https://api.open-meteo.com/v1/forecast",
        "options": {},
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "latitude",
              "value": "35.68"
            },
            {
              "name": "longitude",
              "value": "139.76"
            },
            {
              "name": "daily",
              "value": "temperature_2m_max,temperature_2m_min,precipitation_probability_max"
            },
            {
              "name": "timezone",
              "value": "auto"
            },
            {
              "name": "forecast_days",
              "value": "1"
            }
          ]
        }
      },
      "typeVersion": 4.4
    },
    {
      "id": "f383d70b-df16-486e-9ef9-489db252c426",
      "name": "Shape Weather",
      "type": "n8n-nodes-base.code",
      "position": [
        528,
        560
      ],
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "const d = ($json.daily) || {};\nconst hi = (d.temperature_2m_max || [])[0];\nconst lo = (d.temperature_2m_min || [])[0];\nconst rain = (d.precipitation_probability_max || [])[0];\nreturn { source: 'weather', weather: 'High ' + (hi != null ? hi : '?') + ' / Low ' + (lo != null ? lo : '?') + ', rain chance ' + (rain != null ? rain : '?') + '%' };"
      },
      "typeVersion": 2
    },
    {
      "id": "2f2ee40e-d3e8-4573-b41c-3b1610595a5d",
      "name": "Bundle Sources",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        1024,
        240
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData"
      },
      "typeVersion": 1
    },
    {
      "id": "59acbaa8-a76d-430e-8b52-b00b3e65f0d0",
      "name": "Build Briefing Input",
      "type": "n8n-nodes-base.code",
      "position": [
        1216,
        240
      ],
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "const rows = $json.data || [];\nconst find = function (s) { return rows.find(function (r) { return r.source === s; }) || {}; };\nconst news = find('news');\nconst tasks = find('tasks');\nconst weather = find('weather');\nreturn {\n  headlines: news.headlines || 'No headlines available.',\n  tasks: tasks.tasks || 'No open tasks.',\n  openCount: tasks.openCount || 0,\n  weather: weather.weather || 'Weather unavailable.'\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "2cda8482-5e9a-4334-8517-220c65a3ecc1",
      "name": "Write Morning Briefing with Gemini",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        1408,
        240
      ],
      "parameters": {
        "text": "=You are a warm personal assistant writing a short morning briefing to be read over coffee. Weave the weather, the top headlines and today's tasks into a friendly, motivating note of about 120 words. Open with the weather, mention 2-3 headlines briefly, then focus the person on their most important task. Do not use bullet lists.\n\nWeather: {{ $json.weather }}\n\nHeadlines:\n{{ $json.headlines }}\n\nOpen tasks ({{ $json.openCount }}):\n{{ $json.tasks }}",
        "batching": {},
        "promptType": "define"
      },
      "typeVersion": 1.9
    },
    {
      "id": "74361607-610d-4933-8d37-4e130b984319",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        1408,
        496
      ],
      "parameters": {
        "options": {
          "temperature": 0.5
        },
        "modelName": "models/gemini-3.1-flash-lite"
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "374a7d4c-9354-45bf-9b92-01b03fe4c156",
      "name": "Email the Briefing",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1712,
        240
      ],
      "parameters": {
        "sendTo": "you@example.com",
        "message": "={{ $json.text }}",
        "options": {},
        "subject": "={{ \"Your morning briefing - \" + $now.toFormat(\"cccc d LLLL\") }}",
        "emailType": "text"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "9700f05e-c3a1-47ab-a514-3cac27037280",
      "name": "Overview Sticky",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -528,
        -64
      ],
      "parameters": {
        "width": 440,
        "height": 820,
        "content": "## Combine weather, news and your tasks into one AI morning briefing\n\n### How it works\nThis template shows the parallel-branch and merge pattern. Every morning three independent branches run at once: an RSS feed gives the top headlines, a Google Sheet gives your open tasks, and a free weather API gives today's forecast. Each branch is trimmed to a compact summary, then a Merge node appends all three streams and an Aggregate node bundles them into a single item. A Basic LLM Chain with Google Gemini weaves the weather, headlines and your most important task into one warm, motivating note - not a bullet dump - which is emailed to you before the day starts. The weather branch fails soft, so a flaky API never blocks the briefing.\n\n### Setup\n1. Connect Google Gemini (PaLM) API, Google Sheets and Gmail.\n2. Set your RSS feed URL, your Tasks sheet, the weather latitude/longitude and your email address.\n3. Adjust the schedule to your wake-up time.\n\n### Customization tips\nAdd a calendar branch, or send the briefing to Slack or Telegram instead."
      },
      "typeVersion": 1
    },
    {
      "id": "6d563303-6a47-4241-92b4-f5e8d7b0e24a",
      "name": "S1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -64,
        -64
      ],
      "parameters": {
        "color": 7,
        "width": 764,
        "height": 820,
        "content": "## 1. Three parallel sources\nNews (RSS), tasks (Sheets) and weather (free API) run at the same time, each trimmed to a short summary. Weather fails soft."
      },
      "typeVersion": 1
    },
    {
      "id": "1c8c8fb6-92f8-4425-9f29-08652e3ea83f",
      "name": "S2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        720,
        -64
      ],
      "parameters": {
        "color": 7,
        "width": 436,
        "height": 820,
        "content": "## 2. Merge & bundle\nAppend the three streams with Merge, then Aggregate them into one item so a single AI call sees everything."
      },
      "typeVersion": 1
    },
    {
      "id": "fea493ef-fa91-4e1d-a0d9-91f2382ebba9",
      "name": "S3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1168,
        -64
      ],
      "parameters": {
        "color": 7,
        "width": 768,
        "height": 816,
        "content": "## 3. Write & send (Basic LLM Chain)\nGemini writes one warm briefing from all three sources and emails it before the day starts."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "availableInMCP": true,
    "executionOrder": "v1"
  },
  "versionId": "1f7d4267-f1fd-40ea-9539-90177d0df883",
  "nodeGroups": [],
  "connections": {
    "Get Weather": {
      "main": [
        [
          {
            "node": "Shape Weather",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Shape Weather": {
      "main": [
        [
          {
            "node": "Combine All Sources",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "Bundle Sources": {
      "main": [
        [
          {
            "node": "Build Briefing Input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read News Feed": {
      "main": [
        [
          {
            "node": "Take Top Headlines",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Today Tasks": {
      "main": [
        [
          {
            "node": "List Open Tasks",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "List Open Tasks": {
      "main": [
        [
          {
            "node": "Combine All Sources",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Take Top Headlines": {
      "main": [
        [
          {
            "node": "Combine All Sources",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Combine All Sources": {
      "main": [
        [
          {
            "node": "Bundle Sources",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Briefing Input": {
      "main": [
        [
          {
            "node": "Write Morning Briefing with Gemini",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Every Morning": {
      "main": [
        [
          {
            "node": "Read News Feed",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get Today Tasks",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get Weather",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Write Morning Briefing with Gemini",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Write Morning Briefing with Gemini": {
      "main": [
        [
          {
            "node": "Email the Briefing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}