{
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "bale-chat",
        "responseMode": "responseNode",
        "options": {}
      },
      "id": "09007f10-a11e-44ab-ad75-79402dfa9bb0",
      "name": "Webhook - Bale Chat",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        -624,
        80
      ],
      "webhookId": "bale-chat-v1"
    },
    {
      "parameters": {
        "jsCode": "const SECRET = '2633813394';\n\nconst root = $input.first().json;\nconst headers = root.headers || {};\nconst body = (root.body && typeof root.body === 'object') ? root.body : root;\n\nconst auth = String(headers.authorization || headers.Authorization || '');\nif (!SECRET || SECRET === 'CHANGE_ME_BALE_SECRET') {\n  throw new Error('SECRET is not set: replace CHANGE_ME_BALE_SECRET in this node');\n}\nif (auth !== 'Bearer ' + SECRET) throw new Error('unauthorized');\n\nconst text = String(body.chatInput || body.message || body.text || '').trim().slice(0, 4000);\nif (!text) throw new Error('chatInput is required');\nconst sessionId = String(body.sessionId || body.session_id || body.chatId || '').trim();\nif (!sessionId) throw new Error('sessionId is required');\n\nconst metadata = (body.metadata && typeof body.metadata === 'object') ? body.metadata : {};\n\nconst faDate = new Intl.DateTimeFormat('fa-IR-u-ca-persian', { year: 'numeric', month: '2-digit', day: '2-digit' }).format(new Date());\nconst date = String(faDate).replace(/[۰-۹]/g, function (d) { return '۰۱۲۳۴۵۶۷۸۹'.indexOf(d); });\nconst parts = date.split('/');\nconst year = parts[0] || '';\nconst month = parts[1] || '';\nconst monthNames = { '01': 'فروردین', '02': 'اردیبهشت', '03': 'خرداد', '04': 'تیر', '05': 'مرداد', '06': 'شهریور', '07': 'مهر', '08': 'آبان', '09': 'آذر', '10': 'دی', '11': 'بهمن', '12': 'اسفند' };\nconst monthName = monthNames[month] || '';\n\nconst system = \n[\n  'تو مسیریاب نیت و وضعیت برای ربات بله شهرداری ساری هستی. خروجی فقط JSON معتبر است؛ بدون Markdown، بدون ``` و بدون متن اضافه.',\n  '',\n  'هرگز به سؤال کاربر پاسخ نده.',\n  'هرگز اطلاعات واقعی درباره ساری تولید نکن.',\n  'هرگز نام افراد، سمت‌ها، تلفن‌ها، آدرس‌ها یا تاریخ‌ها را تولید نکن.',\n  'اگر سؤال عمومی است:intent=general',\n  'پاسخ واقعی سؤال در مرحله بعد و فقط از پایگاه دانش تولید خواهد شد.',\n  'کانال فعلی: bale (ربات رسمی). قواعد سخت:',\n  '- هرگز رمز عبور نخواه و هرگز در خروجی قرار نده.',\n  '- اگر metadata کد پرسنلی دارد دیگر کد پرسنلی نخواه.',\n  '- user_message دقیقاً متن کاربر باشد بدون تغییر.',\n  '- اعداد فارسی و عربی را به انگلیسی تبدیل کن.',\n  '',\n  'نیت‌ها:',\n  '1. payroll — فیش حقوقی، حقوق، دستمزد، کسورات، مالیات حقوق، اضافه کار، خالص پرداختی',\n  '2. pasmand_bill — قبض یا عوارض پسماند / زباله',\n  '3. nosazi_bill — قبض یا عوارض نوسازی / عوارض ملک',\n  '4. general — هر سوال عمومی دیگر (شهر ساری، سازمان‌ها، ادارات، آدرس، تلفن، گردشگری، خدمات شهری، تاریخچه، افراد، پروژه‌ها و ...)',\n  '',\n  'مرجع زمانی (برای امسال/پارسال/این ماه/ماه قبل حتماً از همین استفاده کن؛ حدس نزن):',\n  '- امروز: ' + date + ' — سال جاری: ' + year + ' — ماه جاری: ' + month + ' (' + monthName + ')',\n  '- «امسال/سال جاری» → سال=' + year + ' ؛ «پارسال» → سال=' + String(parseInt(year, 10) - 1) + '.',\n  '- «این ماه/ماه جاری» → ماه=' + month + ' و سال=' + year + ' ؛ «ماه قبل» → یک ماه عقب‌تر (اگر ماه 01 شد → ماه 12 و سال یکی کمتر).',\n  '- اگر ماه یا سال مشخصی گفته (مثلاً خرداد 1404) همان بر عبارت نسبی مقدم است.',\n  '- اگر فقط سال گفته ماه را حدس نزن و بالعکس.',\n  '',\n  'ماه‌های شمسی: 01 فروردین، 02 اردیبهشت، 03 خرداد، 04 تیر، 05 مرداد، 06 شهریور، 07 مهر، 08 آبان، 09 آذر، 10 دی، 11 بهمن، 12 اسفند.',\n  '',\n  'فیلدها: برای payroll فقط salary_year و salary_month ؛ برای قبض‌ها فقط tax_code.',\n  'اگر نیت general است: reply خالی باشد (پاسخ را جستجوگر می‌دهد).',\n  'اگر باید کاربر راهنمایی کنی یا اطلاعات ناقص است: در reply یک جملهٔ کوتاه فارسی بنویس (مثلاً «فیش کدام ماه را می‌خواهید؟») و clarify=true.',\n  'اگر اطلاعات کامل است: reply خالی و clarify=false.',\n  '',\n  'ساختار خروجی دقیقاً:',\n  '{',\n  '  \"user_message\": \"string\",',\n  '  \"intent\": \"payroll یا pasmand_bill یا nosazi_bill یا general\",',\n  '  \"personel_code\": \"string یا null\",',\n  '  \"salary_year\": \"string یا null\",',\n  '  \"salary_month\": \"string یا null\",',\n  '  \"tax_code\": \"string یا null\",',\n  '  \"clarify\": true,',\n  '  \"reply\": \"string\"',\n  '}',\n  '',\n  'مثال‌ها:',\n  'کاربر: فیش مهر 1405 را می‌خواهم → payroll / salary_year=1405 / salary_month=07 / reply=\"\" / clarify=false',\n  'کاربر: قبض پسماند را بده → pasmand_bill / tax_code=null / reply=\"لطفاً کد ملک یا کدنوسازی را بگویید تا راهنمایی کنم.\" / clarify=true',\n  'کاربر: قبض نوسازی با کد 3-8-10017-71 → nosazi_bill / tax_code=\"3-8-10017-71\" / reply=\"\" / clarify=false',\n  'کاربر: تاریخچه ساری را بگو → general / reply=\"\" / clarify=false'\n].join('\\n');\n\nreturn [{\n  json: {\n    chatInput: text,\n    user_message: text,\n    sessionId: sessionId,\n    channel: String(body.channel || 'bale'),\n    metadata: metadata,\n    jalali: { date: date, year: year, month: month, monthName: monthName },\n    personel_code: metadata.personel_code ? String(metadata.personel_code) : null,\n    system: system\n  }\n}];"
      },
      "id": "c2844e68-209f-4fe0-813b-8b0d3f9f6f23",
      "name": "Normalize Bot Input",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -400,
        80
      ],
      "notes": "SECRET را روی همان N8N_WEBHOOK_SECRET ربات تنظیم کنید. پرامپت Intent هم داخل همین گره ساخته می‌شود."
    },
    {
      "parameters": {
        "sessionIdType": "customKey",
        "sessionKey": "={{ $json.sessionId }}",
        "contextWindowLength": 10
      },
      "id": "c17270d8-5018-476f-bf4a-9460ea82aa0b",
      "name": "Intent Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.3,
      "position": [
        -48,
        320
      ],
      "notes": "حافظهٔ مکالمهٔ مسیریاب نیت (برای ادامهٔ گفتگوی چندمرحله‌ای فیش/قبض)."
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $json.chatInput }}",
        "options": {
          "systemMessage": "={{ $json.system }}"
        }
      },
      "id": "513c25b0-9c62-4169-ba9b-fdcab31eec1d",
      "name": "Intent + State Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 1.7,
      "position": [
        -176,
        80
      ],
      "notes": "systemMessage از گره Normalize Bot Input می‌آید (تاریخ شمسی پویا)."
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "value": "gemini/gemini-3.5-flash-lite",
          "mode": "list",
          "cachedResultName": "gemini/gemini-3.5-flash-lite"
        },
        "responsesApiEnabled": false,
        "options": {
          "maxTokens": 2000,
          "temperature": 0
        }
      },
      "id": "9f9a311c-8631-4a53-bd17-9ef9a3803014",
      "name": "Intent Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.3,
      "position": [
        -176,
        320
      ],
      "credentials": {
        "openAiApi": {
          "id": "GaUwIK2WYNzgpe8W",
          "name": "9Router"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "const src = $('Normalize Bot Input').first().json;\nconst allowed = ['payroll', 'pasmand_bill', 'nosazi_bill', 'general'];\nconst raw = String($input.first().json.output || '').trim();\n\nfunction toEn(v) {\n  return String(v == null ? '' : v)\n    .replace(/[۰-۹]/g, d => '۰۱۲۳۴۵۶۷۸۹'.indexOf(d))\n    .replace(/[٠-٩]/g, d => '٠١٢٣٤٥٦٧٨٩'.indexOf(d))\n    .trim();\n}\n\nfunction extractJson(text) {\n  try { return JSON.parse(text); } catch (e) {}\n  const cleaned = text.replace(/^```(?:json)?\\s*/i, '').replace(/\\s*```$/i, '').trim();\n  try { return JSON.parse(cleaned); } catch (e) {}\n  const start = text.indexOf('{');\n  const end = text.lastIndexOf('}');\n  if (start !== -1 && end > start) {\n    try { return JSON.parse(text.slice(start, end + 1)); } catch (e) {}\n  }\n  return null;\n}\n\nlet data = extractJson(raw);\nconst parseOk = !!data && typeof data === 'object' && !Array.isArray(data);\nif (!parseOk) data = {};\n\nlet intent = String(data.intent || '').toLowerCase().trim();\nif (!allowed.includes(intent)) intent = 'general';\n\nlet year = toEn(data.salary_year);\nyear = /^\\d{4}$/.test(year) ? year : null;\n\nlet month = toEn(data.salary_month);\nmonth = (/^\\d{1,2}$/.test(month) && +month >= 1 && +month <= 12) ? month.padStart(2, '0') : null;\n\nconst taxCode = toEn(data.tax_code) || null;\nconst personelCode = toEn(data.personel_code) || null;\n\nconst out = {\n  user_message: src.chatInput,\n  intent: intent,\n  personel_code: personelCode,\n  salary_year: year,\n  salary_month: month,\n  tax_code: taxCode,\n  clarify: parseOk && data.clarify === true,\n  reply: (parseOk && typeof data.reply === 'string') ? data.reply.trim() : '',\n  parse_ok: parseOk,\n  sessionId: src.sessionId,\n  channel: src.channel,\n  metadata: src.metadata,\n  jalali: src.jalali\n};\n\nif (out.intent === 'general') out.reply = '';\n\nreturn [{ json: out }];"
      },
      "id": "2b542204-4bc4-4b07-902c-71ce1960c9de",
      "name": "Parse Intent",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        176,
        80
      ],
      "notes": "پاکسازی ```json، اعتبارسنجی سخت intent (enum) و حمل sessionId از Normalize."
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "is-general",
              "leftValue": "={{ $json.intent }}",
              "rightValue": "general",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "2a2402d6-47a6-40fe-8707-b7c3b38b9d04",
      "name": "Is General Intent?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        400,
        80
      ]
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $json.user_message }}",
        "options": {
          "systemMessage": "تو یک دستیار هوشمند دانشنامه شهر ساری هستی.\n\nوظیفه تو پاسخ‌گویی دقیق به سوالات کاربران درباره شهر ساری، سازمان‌ها، ادارات، خدمات شهری، تاریخچه، گردشگری، مکان‌ها، افراد، پروژه‌ها و اطلاعات عمومی است.\n\nقوانین:\n1. همیشه برای سوالات عمومی درباره ساری از ابزار SariDataSheet استفاده کن.\n2. فقط بر اساس اطلاعاتی که SariDataSheet برمی‌گرداند پاسخ بده.\n3. هرگز اطلاعات، آدرس، شماره تلفن، نام افراد یا تاریخ‌ها را حدس نزن.\n4. اگر اطلاعات مورد نیاز در پایگاه دانش نبود، صریحاً بگو: «اطلاعات کافی در پایگاه دانش موجود نیست.»\n5. نتایج مرتبط را با هم بررسی کن.\n6. پاسخ‌ها فارسی، روان، کوتاه و دقیق باشند.\n7. در پاسخ نهایی به Qdrant یا ابزار داخلی اشاره نکن.\n8. این Agent فقط برای سوالات عمومی شهر ساری است؛ برای فیش حقوقی، قبض و خدمات ربات اصلاً وارد نشو (مسیریاب جدا دارد).\n\nاگر ابزار SariDataSheet نتیجه‌ای برنگرداند، همان «اطلاعات کافی در پایگاه دانش موجود نیست.» را بگو و از حدس‌زدن خودداری کن."
        }
      },
      "id": "6db63ea0-8ac1-40e9-b297-31805900e4a9",
      "name": "General RAG Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 1.7,
      "position": [
        688,
        256
      ]
    },
    {
      "parameters": {
        "sessionIdType": "customKey",
        "sessionKey": "={{ $json.sessionId }}",
        "contextWindowLength": 10
      },
      "id": "9730e98a-5287-44ff-afdc-28f1437eb1e6",
      "name": "General Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.3,
      "position": [
        704,
        496
      ],
      "notes": "حافظهٔ مکالمهٔ سوالات عمومی (کلید = sessionId که ربات می‌فرستد)."
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "value": "gemini/gemini-3.5-flash-lite",
          "mode": "list",
          "cachedResultName": "gemini/gemini-3.5-flash-lite"
        },
        "responsesApiEnabled": false,
        "options": {
          "maxTokens": 2000,
          "temperature": 0.1
        }
      },
      "id": "cc54202b-22da-47f4-ba8e-98d5d8e744c9",
      "name": "General Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.3,
      "position": [
        496,
        480
      ],
      "credentials": {
        "openAiApi": {
          "id": "GaUwIK2WYNzgpe8W",
          "name": "9Router"
        }
      }
    },
    {
      "parameters": {
        "mode": "retrieve-as-tool",
        "toolName": "SariDataSheet",
        "toolDescription": "پایگاه دانش تخصصی شهر ساری. برای سوالات عمومی درباره سازمان‌ها، ادارات، آدرس، شماره تماس، مدیران، تاریخچه، خدمات شهری، پروژه‌های شهری، مکان‌های گردشگری و تاریخی و اطلاعات عمومی شهر استفاده می‌شود.",
        "qdrantCollection": {
          "__rl": true,
          "value": "=SariKnowledgeV2",
          "mode": "id"
        },
        "options": {
          "contentPayloadKey": "pageContent",
          "metadataPayloadKey": "metadata"
        }
      },
      "id": "d2ca00e7-f083-4606-a09b-f2aaf3e1c7d9",
      "name": "SariDataSheet",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
      "typeVersion": 1,
      "position": [
        896,
        496
      ],
      "credentials": {
        "qdrantApi": {
          "id": "nN9p7NYs1cwcqqNP",
          "name": "Qdrant account"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "const a = $input.first().json;\nconst s = $('Parse Intent').first().json;\nconst out = String(a.output || '').trim();\nreturn [{ json: { ok: true, sessionId: s.sessionId, intent: 'general', output: out } }];"
      },
      "id": "69118ef2-d5fb-456e-85ad-cdc00cbbacce",
      "name": "Pack General Response",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1248,
        256
      ],
      "notes": "خروجی RAG را به شکل {ok, sessionId, intent, output} درمی‌آورد. اگر خالی باشد ربات خودش به کارشناس واگذار می‌کند."
    },
    {
      "parameters": {
        "jsCode": "const s = $input.first().json;\nconst months = { '01': 'فروردین', '02': 'اردیبهشت', '03': 'خرداد', '04': 'تیر', '05': 'مرداد', '06': 'شهریور', '07': 'مهر', '08': 'آبان', '09': 'آذر', '10': 'دی', '11': 'بهمن', '12': 'اسفند' };\n\nfunction faNum(v) {\n  return String(v).replace(/[0-9]/g, function (d) { return '۰۱۲۳۴۵۶۷۸۹'[d]; });\n}\n\nlet out = s.reply ? String(s.reply).trim() : '';\n\nif (!out) {\n  if (s.intent === 'payroll') {\n    let when = '';\n    if (s.salary_month && months[s.salary_month]) {\n      when = '\\n\\nماه انتخابی شما: ' + months[s.salary_month] + ' ' + faNum(s.salary_year || (s.jalali && s.jalali.year) || '');\n    } else if (s.salary_year) {\n      when = '\\n\\nسال انتخابی شما: ' + faNum(s.salary_year);\n    }\n    out = 'فیش حقوقی از دکمهٔ «فیش حقوقی» در منوی اصلی ربات در دسترس است؛ سال و ماه را در همان صفحه انتخاب کنید تا PDF فیش برایتان ارسال شود.' + when;\n  } else if (s.intent === 'pasmand_bill' || s.intent === 'nosazi_bill') {\n    const title = s.intent === 'pasmand_bill' ? 'پسماند' : 'نوسازی';\n    if (s.tax_code) {\n      out = 'برای استعلام قبض ' + title + ' با کد ' + s.tax_code + ':\\n۱) ابتدا «افزودن کد نوسازی» را بزنید و کد را ثبت کنید؛\\n۲) سپس از «مشاهده آخرین بدهی» و «کدنوسازی های من» استفاده کنید.';\n    } else {\n      out = 'برای استعلام قبض ' + title + ' از دکمه‌های «مشاهده آخرین بدهی» و «کدنوسازی های من» در منوی اصلی استفاده کنید. اگر کد ملک/کدنوسازی دارید، اول آن را با «افزودن کد نوسازی» ثبت کنید.';\n    }\n  } else {\n    out = 'متوجه نشدم منظورتان چیست. لطفاً پیام را واضح‌تر بنویسید یا از دکمه‌های منوی اصلی استفاده کنید. برای گفتگو با کارشناس هم می‌توانید همین‌جا پیام بدهید.';\n  }\n}\n\nreturn [{ json: { ok: true, sessionId: s.sessionId, intent: s.intent, output: out } }];"
      },
      "id": "7bc08250-b607-4902-ac57-c7ea91e910c3",
      "name": "Build Guidance Reply",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1248,
        -96
      ],
      "notes": "برای فیش/قبض: اگر reply از ایجنت آمده همان را می‌فرستد، وگرنه پیام راهنمای قطعی دکمه‌های ربات."
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ { ok: true, sessionId: $json.sessionId ?? null, intent: $json.intent ?? null, output: $json.output ?? \"\" } }}",
        "options": {}
      },
      "id": "5c7811d8-e431-4b73-a5ba-10e714e98a22",
      "name": "Respond to Bot",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.4,
      "position": [
        1472,
        80
      ]
    },
    {
      "parameters": {
        "model": "bge-m3:latest"
      },
      "type": "@n8n/n8n-nodes-langchain.embeddingsOllama",
      "typeVersion": 1,
      "position": [
        976,
        704
      ],
      "id": "0d246f93-5323-41f8-a175-b474c1e3498b",
      "name": "Embeddings Ollama",
      "credentials": {
        "ollamaApi": {
          "id": "KIBHMKmkvlDa6TJT",
          "name": "Ollama account"
        }
      }
    }
  ],
  "connections": {
    "Webhook - Bale Chat": {
      "main": [
        [
          {
            "node": "Normalize Bot Input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Normalize Bot Input": {
      "main": [
        [
          {
            "node": "Intent + State Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Intent Memory": {
      "ai_memory": [
        [
          {
            "node": "Intent + State Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Intent + State Agent": {
      "main": [
        [
          {
            "node": "Parse Intent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Intent Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Intent + State Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Parse Intent": {
      "main": [
        [
          {
            "node": "Is General Intent?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is General Intent?": {
      "main": [
        [
          {
            "node": "General RAG Agent",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Build Guidance Reply",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "General RAG Agent": {
      "main": [
        [
          {
            "node": "Pack General Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "General Memory": {
      "ai_memory": [
        [
          {
            "node": "General RAG Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "General Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "General RAG Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "SariDataSheet": {
      "ai_tool": [
        [
          {
            "node": "General RAG Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Pack General Response": {
      "main": [
        [
          {
            "node": "Respond to Bot",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Guidance Reply": {
      "main": [
        [
          {
            "node": "Respond to Bot",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings Ollama": {
      "ai_embedding": [
        [
          {
            "node": "SariDataSheet",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {
    "Webhook - Bale Chat": [
      {
        "headers": {
          "host": "n8n.esaricity.ir",
          "x-forwarded-for": "176.126.120.243, 172.71.172.210",
          "authorization": "Bearer 2633813394",
          "accept": "application/json",
          "content-type": "application/json",
          "accept-encoding": "gzip, br",
          "cf-ray": "a4d58e53ee2ad349-FRA",
          "cdn-loop": "cloudflare; loops=1",
          "cf-connecting-ip": "176.126.120.243",
          "cf-ipcountry": "IR",
          "cf-visitor": "{\"scheme\":\"https\"}",
          "x-forwarded-proto": "https",
          "x-forwarded-port": "443",
          "x-forwarded-host": "n8n.esaricity.ir, n8n.esaricity.ir",
          "x-forwarded-server": "n8n.esaricity.ir",
          "content-length": "94",
          "connection": "Keep-Alive"
        },
        "params": {},
        "query": {},
        "body": {
          "chatInput": "s",
          "sessionId": "636118907",
          "channel": "bale",
          "metadata": {
            "personel_code": "6114"
          }
        },
        "webhookUrl": "https://n8n.esaricity.ir/webhook/bale-chat",
        "executionMode": "production"
      }
    ]
  },
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "926205f0965dc0a2b06a6126cfb4fb657791b1375bd1d2fb23ad447f7325303b"
  }
}