{
  "name": "COS \u00c2\u00b7 Hourly Research Digest \u00e2\u2020\u2019 Mattermost",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "hoursInterval": 1
            }
          ]
        }
      },
      "id": "e1f2a3b4-0001-0001-0001-000000000001",
      "name": "Every hour",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        200,
        300
      ]
    },
    {
      "parameters": {
        "method": "GET",
        "url": "https://search.32dots.de/search",
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "q",
              "value": "CRISPR latest research 2026"
            },
            {
              "name": "format",
              "value": "json"
            },
            {
              "name": "categories",
              "value": "science"
            },
            {
              "name": "language",
              "value": "en"
            }
          ]
        },
        "options": {}
      },
      "id": "e1f2a3b4-0001-0001-0001-000000000002",
      "name": "Search: CRISPR research",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        440,
        300
      ]
    },
    {
      "parameters": {
        "jsCode": "const results = $input.first().json.results?.slice(0, 5) || [];\nif (results.length === 0) return [{ json: { prompt: 'No results found.' } }];\nconst text = results.map((r, i) =>\n  `${i+1}. **${r.title}**\\n${r.content || ''}\\nSource: ${r.url}`\n).join('\\n\\n');\nreturn [{ json: { prompt: text, query: 'CRISPR latest research 2026' } }];"
      },
      "id": "e1f2a3b4-0001-0001-0001-000000000003",
      "name": "Extract top 5 results",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        680,
        300
      ]
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=You are a science communicator for students. Here are the top 5 web results for \"{{ $json.query }}\":\n\n{{ $json.prompt }}\n\nWrite a concise 3-bullet summary in plain language. Each bullet max 1 sentence. End with one sentence on why this matters for AI in science.",
        "options": {}
      },
      "id": "e1f2a3b4-0001-0001-0001-000000000004",
      "name": "AI Summariser",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 3.1,
      "position": [
        920,
        300
      ]
    },
    {
      "parameters": {
        "model": "llama-3.3-70b-versatile",
        "options": {}
      },
      "id": "e1f2a3b4-0001-0001-0001-000000000005",
      "name": "Groq",
      "type": "@n8n/n8n-nodes-langchain.lmChatGroq",
      "typeVersion": 1,
      "position": [
        920,
        480
      ],
      "credentials": {
        "groqApi": {
          "id": "groq-shared-cred",
          "name": "Groq (shared, students)"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://mattermost.32dots.de/hooks/yar59motxtgj7rf7shwio1dyoa",
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "text",
              "value": "=\u00f0\u0178\u201d\u00ac **Research Digest \u00e2\u20ac\u201d {{ $now.toFormat('HH:mm') }}**\n_Topic: CRISPR latest research_\n\n{{ $json.output }}"
            },
            {
              "name": "username",
              "value": "Research Bot"
            },
            {
              "name": "icon_emoji",
              "value": ":microscope:"
            }
          ]
        },
        "options": {}
      },
      "id": "e1f2a3b4-0001-0001-0001-000000000006",
      "name": "Post digest to #AI-test",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1160,
        300
      ]
    }
  ],
  "connections": {
    "Every hour": {
      "main": [
        [
          {
            "node": "Search: CRISPR research",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search: CRISPR research": {
      "main": [
        [
          {
            "node": "Extract top 5 results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract top 5 results": {
      "main": [
        [
          {
            "node": "AI Summariser",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Summariser": {
      "main": [
        [
          {
            "node": "Post digest to #AI-test",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Groq": {
      "ai_languageModel": [
        [
          {
            "node": "AI Summariser",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "meta": {
    "templateCredsSetupCompleted": true
  }
}