{
  "name": "Remix 2: Feed your brief",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 7
            }
          ]
        }
      },
      "id": "c59fad48-ec97-4224-bd1b-45cf4ac74b46",
      "name": "Every morning at 7",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        672,
        -48
      ]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "719f0d54-0488-4e76-8cba-bb5f7995e2a5",
              "name": "topics",
              "value": "AI agents, Gemini, n8n",
              "type": "string"
            },
            {
              "id": "f38fa2e0-0400-4d90-8f03-c7e6070f38f7",
              "name": "city",
              "value": "Paderborn",
              "type": "string"
            },
            {
              "id": "9f3683b7-8e56-4b76-9954-dd8153aa9b78",
              "name": "latitude",
              "value": 51.72,
              "type": "number"
            },
            {
              "id": "90c309bb-5bb1-4f8b-ade7-289f3367b804",
              "name": "longitude",
              "value": 8.76,
              "type": "number"
            },
            {
              "id": "a0e765cf-a0c3-43cb-9924-cd63c710cac8",
              "name": "email",
              "value": "you@example.com",
              "type": "string"
            },
            {
              "id": "cf7ad699-1d00-4a74-89f6-672f4d7de52a",
              "name": "github_repo",
              "value": "n8n-io/n8n",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "8fc576ff-963e-42ba-8dbb-7eba0f7ef06e",
      "name": "My settings",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        896,
        -48
      ]
    },
    {
      "parameters": {
        "url": "=https://api.open-meteo.com/v1/forecast?latitude={{ $('My settings').first().json.latitude }}&longitude={{ $('My settings').first().json.longitude }}&daily=temperature_2m_max,temperature_2m_min,precipitation_probability_max&timezone=auto&forecast_days=1",
        "options": {}
      },
      "id": "c1c142ba-4a5a-4496-9d32-8fa18705375c",
      "name": "Get weather",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1120,
        -48
      ]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "e425d589-7c8f-44ec-831a-bf8eafabb7c8",
              "name": "temp_min",
              "value": "={{ $json.daily.temperature_2m_min[0] }}",
              "type": "number"
            },
            {
              "id": "acefaaae-c2da-4701-9519-c0a6d2a1c11f",
              "name": "temp_max",
              "value": "={{ $json.daily.temperature_2m_max[0] }}",
              "type": "number"
            },
            {
              "id": "5e1caa3f-6985-467f-9002-a498bba17eda",
              "name": "rain_chance",
              "value": "={{ $json.daily.precipitation_probability_max[0] }}",
              "type": "number"
            },
            {
              "id": "7efe963e-ab39-4f98-a039-edafe0b64074",
              "name": "summary",
              "value": "={{ $json.daily.temperature_2m_min[0] }} to {{ $json.daily.temperature_2m_max[0] }} °C, {{ $json.daily.precipitation_probability_max[0] }}% chance of rain",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "e7332e86-70c1-43b2-8d3b-9f417a1f423a",
      "name": "Format weather",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        1344,
        -48
      ]
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "loose",
            "version": 2
          },
          "conditions": [
            {
              "id": "0b58d2e0-cb7b-4257-ab3e-ace25cbd69e0",
              "leftValue": "={{ $json.rain_chance }}",
              "rightValue": 50,
              "operator": {
                "type": "number",
                "operation": "gt"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "ddcc7333-2cf5-4986-9d3c-7da7ffb913dc",
      "name": "Rain over 50%?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        1552,
        -48
      ]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "7530c764-d124-467a-834d-72fc8cd628fc",
              "name": "umbrella_note",
              "value": "☔ Take an umbrella today.",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "a7430bbd-b707-4ea3-addb-77b8a9c7d7e3",
      "name": "Umbrella note",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        1776,
        -208
      ]
    },
    {
      "parameters": {
        "url": "=https://news.google.com/rss/search?q={{ encodeURIComponent($('My settings').first().json.topics.split(',').map(t => '\"' + t.trim() + '\"').join(' OR ') + ' when:1d') }}&hl=en-US&gl=US&ceid=US:en",
        "options": {}
      },
      "id": "a16f782f-c2fb-48b9-aedd-b3eca90cc549",
      "name": "Google News",
      "type": "n8n-nodes-base.rssFeedRead",
      "typeVersion": 1.1,
      "position": [
        2000,
        -48
      ]
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=Write my morning brief for today, {{ $now.toFormat('cccc, d LLLL') }}.\n\nWeather in {{ $('My settings').first().json.city }}: {{ $('Format weather').first().json.summary }}\n\nNews on my topics from Google News:\n{{ $('Google News').all().slice(0, 15).map(item => '- ' + item.json.title + ' (' + item.json.link + ')').join('\\n') }}\n\nAlso check the Hacker News front page with your tool and include stories that fit my interests.\n\nNew releases of {{ $('My settings').first().json.github_repo }}:\n{{ $('GitHub releases').all().slice(0, 3).map(item => '- ' + item.json.title + ' (' + item.json.link + ')').join('\\n') }}\n\nAlso check my calendar for today with your calendar tool.",
        "options": {
          "systemMessage": "=You are my personal morning briefing assistant.\nMy interests: {{ $('My settings').first().json.topics }}.\n\nYour sources:\n- Today's weather and Google News stories, in the message\n- New releases of {{ $('My settings').first().json.github_repo }}, in the message\n- My Google Calendar, through your calendar tool\n- The Hacker News front page, through your Hacker News tool\n\nWrite a short brief in plain text, no Markdown, in this order:\n1. One line on today's weather.\n2. Today's calendar events with their start times. Leave this part out if there are none.\n3. The 3 to 5 most relevant stories for my interests, each with one sentence and its link.\n4. New releases of {{ $('My settings').first().json.github_repo }}, one line each. Leave this part out if there are none.\n\nOnly use information from these sources. Never use your own knowledge for news, events or releases.\nKeep the brief under 250 words."
        }
      },
      "id": "64c7d777-85b2-4a90-9ab0-815638b5273d",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 1.8,
      "position": [
        2448,
        -48
      ],
      "executeOnce": true
    },
    {
      "parameters": {
        "modelName": "models/gemini-3.5-flash-lite",
        "options": {}
      },
      "id": "697e0f07-dd58-4693-ac98-80f9be38385a",
      "name": "Gemini",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "typeVersion": 1,
      "position": [
        2448,
        192
      ]
    },
    {
      "parameters": {
        "toolDescription": "Returns the current Hacker News front page stories (title, url, points) as JSON.",
        "url": "https://hn.algolia.com/api/v1/search?tags=front_page&hitsPerPage=10&attributesToRetrieve=title,url,points&attributesToHighlight=%5B%5D",
        "options": {}
      },
      "id": "63ce100e-6583-484f-9831-f990fc76cd0d",
      "name": "Hacker News",
      "type": "n8n-nodes-base.httpRequestTool",
      "typeVersion": 4.2,
      "position": [
        2592,
        192
      ]
    },
    {
      "parameters": {
        "sendTo": "={{ $('My settings').first().json.email }}",
        "subject": "=Your daily brief, {{ $now.toFormat('ccc d LLL') }}",
        "emailType": "text",
        "message": "={{ $('Umbrella note').isExecuted ? $('Umbrella note').first().json.umbrella_note + '\\n\\n' : '' }}{{ $json.output }}",
        "options": {
          "appendAttribution": false
        }
      },
      "id": "e83d192b-3e24-48bd-b28f-ca1ef4ee6b84",
      "name": "Send brief",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.1,
      "position": [
        2960,
        -48
      ],
      "webhookId": "1a5ac51b-cf30-41ec-a116-7b76bd1d479f"
    },
    {
      "parameters": {
        "content": "## 1. Settings and weather\nYour topics, city and email in one place. Then: get the weather, cut the JSON down, check for rain.",
        "height": 628,
        "width": 1296,
        "color": 7
      },
      "id": "3c217bb5-22d7-439d-a97c-1b69ad4a5e1f",
      "name": "Stage 1",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        608,
        -288
      ]
    },
    {
      "parameters": {
        "content": "## 3. News\nGoogle News (fixed) and Hacker News (a tool the agent can call).",
        "height": 640,
        "width": 424,
        "color": 6
      },
      "id": "fce5661b-1626-45e2-ac6a-4cba6f2f3c52",
      "name": "Stage 3",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        1936,
        -288
      ]
    },
    {
      "parameters": {
        "content": "## 2. The agent\nGemini writes the brief.",
        "height": 640,
        "width": 476,
        "color": 5
      },
      "id": "79818e00-c387-4ee8-a592-cbab61ccd1c7",
      "name": "Stage 2",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        2384,
        -288
      ]
    },
    {
      "parameters": {
        "content": "## 4. Send\nEmail to yourself. Then switch the workflow on.",
        "height": 644,
        "width": 260,
        "color": 4
      },
      "id": "ec1f8201-a99a-4ebf-866b-71d7ab8d410a",
      "name": "Stage 4",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        2880,
        -288
      ]
    },
    {
      "parameters": {
        "url": "=https://github.com/{{ $('My settings').first().json.github_repo }}/releases.atom",
        "options": {}
      },
      "id": "5c040570-5543-41e9-8b63-297b6319ae1e",
      "name": "GitHub releases",
      "type": "n8n-nodes-base.rssFeedRead",
      "typeVersion": 1.1,
      "position": [
        2224,
        -48
      ],
      "executeOnce": true
    },
    {
      "parameters": {
        "operation": "getAll",
        "calendar": {
          "__rl": true,
          "value": "primary",
          "mode": "list",
          "cachedResultName": "primary"
        },
        "limit": 20,
        "timeMin": "={{ $today.toISO() }}",
        "timeMax": "={{ $today.plus({ days: 1 }).toISO() }}",
        "options": {}
      },
      "id": "9336d8e9-e109-47a9-a407-428f3351925d",
      "name": "My calendar",
      "type": "n8n-nodes-base.googleCalendarTool",
      "typeVersion": 1.3,
      "position": [
        2720,
        192
      ]
    },
    {
      "parameters": {
        "content": "## Remix: Feed your brief\nTwo new sources: GitHub releases of a repo you follow (RSS, set the repo in My settings) and your Google Calendar as a tool. Sign in with Google once.\n\nEvery new source also goes into the system prompt: the agent needs to know it exists and where it belongs in the brief.",
        "height": 196,
        "width": 420,
        "color": 3
      },
      "id": "fa89c887-7a91-4610-a769-6d24d20840cc",
      "name": "Remix note",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        2416,
        368
      ]
    }
  ],
  "pinData": {},
  "connections": {
    "Every morning at 7": {
      "main": [
        [
          {
            "node": "My settings",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get weather": {
      "main": [
        [
          {
            "node": "Format weather",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format weather": {
      "main": [
        [
          {
            "node": "Rain over 50%?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Rain over 50%?": {
      "main": [
        [
          {
            "node": "Umbrella note",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Google News",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Umbrella note": {
      "main": [
        [
          {
            "node": "Google News",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google News": {
      "main": [
        [
          {
            "node": "GitHub releases",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gemini": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Hacker News": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Send brief",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "My settings": {
      "main": [
        [
          {
            "node": "Get weather",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GitHub releases": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "My calendar": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1",
    "binaryMode": "separate"
  }
}