{
  "name": "Datavej: electricity-cost assistant",
  "nodes": [
    {
      "id": "0282d5bf-8de1-574d-8ccb-13635e8e3eb1",
      "name": "Setup",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -460,
        -120
      ],
      "parameters": {
        "content": "## Datavej setup\n1. Create an API key at https://datavej.dk/dashboard#keys.\n2. Open the **Datavej** node, choose **Bearer Auth** and create a credential with the key as the token.\n   Prefer signing in? Switch Authentication to **MCP OAuth2** and connect: n8n registers itself and you approve it in the browser.\n3. Pick your OpenAI credential on **OpenAI Chat Model** (or swap in another chat model), then open the chat.\n\nGuide: https://datavej.dk/n8n\n\nTry: *When is electricity cheapest in Copenhagen tomorrow, and what does a kWh cost with Radius tariffs?*",
        "width": 420,
        "height": 360
      }
    },
    {
      "id": "86bc806e-15f7-5e00-a18f-c811863a979f",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "typeVersion": 1.1,
      "position": [
        0,
        0
      ],
      "webhookId": "9ea8525f-00b8-58c7-895e-f803641ae3a8",
      "parameters": {
        "options": {}
      }
    },
    {
      "id": "037e80e5-b51e-53d7-9f31-5f6f83bf2bcb",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2,
      "position": [
        260,
        0
      ],
      "parameters": {
        "options": {
          "systemMessage": "You are an electricity-cost assistant for Danish households and small businesses. Use Datavej's tools for every number. Work out the bidding zone: DK1 is Jutland and Funen, DK2 is Zealand, Copenhagen and Bornholm (use place_lookup when only a town is given). Use electricity_prices for spot prices, electricity_tariffs for the grid company's tariffs and the all-in price, and electricity_co2 when the user asks about emissions. Answer briefly: the cheapest and most expensive hours, the all-in price per kWh when you have it, and a concrete suggestion (for example when to run the dishwasher or charge the car). Say which date and zone the prices are for, and end with the source attribution lines the tools return."
        }
      }
    },
    {
      "id": "5bc4a3e7-c0df-561e-a031-c8b6d8f32a26",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        140,
        240
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      }
    },
    {
      "id": "0fce98e7-cd83-508b-bd23-d3d913748cee",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.3,
      "position": [
        300,
        240
      ],
      "parameters": {}
    },
    {
      "id": "fa9d7864-ffcb-5550-8961-5615e8baf9d3",
      "name": "Datavej",
      "type": "@n8n/n8n-nodes-langchain.mcpClientTool",
      "typeVersion": 1.2,
      "position": [
        460,
        240
      ],
      "parameters": {
        "endpointUrl": "https://datavej.dk/mcp",
        "serverTransport": "httpStreamable",
        "authentication": "bearerAuth",
        "include": "selected",
        "includeTools": [
          "electricity_prices",
          "electricity_tariffs",
          "electricity_co2",
          "place_lookup"
        ],
        "options": {}
      }
    }
  ],
  "connections": {
    "When chat message received": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Datavej": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "pinData": {},
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "tags": []
}
