{
  "name": "Agent AI na webhooku",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "pytanie",
        "responseMode": "responseNode",
        "options": {}
      },
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $json.body.pytanie }}",
        "options": {
          "systemMessage": "Odpowiadasz po polsku, rzeczowo, maksymalnie 120 słów. Jeśli nie znasz odpowiedzi, powiedz to wprost."
        }
      },
      "name": "Agent AI",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 1.7,
      "position": [
        240,
        0
      ]
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        240,
        200
      ]
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ { odpowiedz: $json.output } }}",
        "options": {}
      },
      "name": "Odpowiedz",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.1,
      "position": [
        520,
        0
      ]
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Agent AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Agent AI": {
      "main": [
        [
          {
            "node": "Odpowiedz",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Agent AI",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1",
    "timezone": "Europe/Warsaw"
  },
  "meta": {
    "source": "agentflow.pl/n8n/szablony"
  },
  "pinData": {}
}