{
  "name": "Vapi Grumpy Weather Assistant",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "6bf9d67a-471f-476d-92eb-2b2a87c75279",
        "responseMode": "responseNode",
        "options": {}
      },
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2.1,
      "position": [
        0,
        0
      ],
      "id": "32e55199-6aca-43c0-928b-414fe32e3bb3",
      "name": "Webhook",
      "webhookId": "6bf9d67a-471f-476d-92eb-2b2a87c75279"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=What's the weather for {{ $json.body.message.toolCalls[0].function.arguments.location }}",
        "options": {
          "systemMessage": "First, provide the current temperature and weather condition for the requested city. \nKeep your response under two sentences."
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 3,
      "position": [
        208,
        0
      ],
      "id": "ee0862d4-a0d5-4cf0-87c1-a0c844026eb4",
      "name": "AI Agent"
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "builtInTools": {},
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.3,
      "position": [
        80,
        208
      ],
      "id": "621458ea-0d15-4a3e-9247-613df0103c36",
      "name": "OpenAI Chat Model",
      "credentials": {
        "openAiApi": {
          "id": "EaHAE2NZa2gYhEPa",
          "name": "OpenAi account"
        }
      }
    },
    {
      "parameters": {
        "cityName": "={{ $('Webhook').item.json.body.message.toolCalls[0].function.arguments.location }}"
      },
      "type": "n8n-nodes-base.openWeatherMapTool",
      "typeVersion": 1,
      "position": [
        368,
        208
      ],
      "id": "a5e2499e-6629-4b23-8b13-5a87f4f459bc",
      "name": "OpenWeatherMap",
      "credentials": {
        "openWeatherMapApi": {
          "id": "JDROs4q7rpX2Q8JH",
          "name": "OpenWeatherMap account 3"
        }
      }
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={\n  \"results\": [\n    {\n      \"toolCallId\": \"{{ $('Webhook').item.json.body.message.artifact.messages[3].toolCalls[0].id }}\",\n      \"result\": \"{{ $json.output }}\"\n    }\n  ]\n}\n",
        "options": {}
      },
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.4,
      "position": [
        560,
        0
      ],
      "id": "959abf86-228c-4597-aa81-99d695405501",
      "name": "Respond to Webhook"
    }
  ],
  "pinData": {},
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenWeatherMap": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "3b2c592f-9ad9-4c7f-8465-dcfd8e709fb9",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "7425b88d6f52190dec1f6e67c1b6cffa1a87557717f26de52e85eaddcf276948"
  },
  "id": "DOYJEw1RRDuHIPiT",
  "tags": []
}