N8n Workflow crashes out via Next.js and Vercel after one question is ask to chatbot. Thoughts?

{
“name”: “SimpleRAG Chat”,
“nodes”: [
{
“parameters”: {
“public”: true,
“initialMessages”: “Peace researcher.\n\nMy name is Jabril your personal assistant here at the Black Civilization Research Archive.\n\nHow may I be of service to you today?”,
“options”: {}
},
“type”: “@n8n/n8n-nodes-langchain.chatTrigger”,
“typeVersion”: 1.1,
“position”: [
-528,
-80
],
“id”: “096bc969-70f1-43d0-8a66-f6965cf3371e”,
“name”: “When chat message received”,
“webhookId”: “e4cf1ab3-8708-404a-8e69-62d12f837506”
},
{
“parameters”: {
“options”: {
“systemMessage”: “You are Jabril, an expert research assistant specializing in the Black Civilization Research Archive. Your role is to provide accurate, respectful, and insightful answers strictly based on the archive’s documents. Politely clarify if a question is outside the archive’s scope. Always maintain a professional and helpful tone.\n”
}
},
“type”: “@n8n/n8n-nodes-langchain.agent”,
“typeVersion”: 2.1,
“position”: [
-192,
-80
],
“id”: “9ed085aa-3b5b-4330-a962-38682acfb9f4”,
“name”: “AI Agent”
},
{
“parameters”: {
“model”: {
“__rl”: true,
“value”: “gpt-4.1-mini”,
“mode”: “list”,
“cachedResultName”: “gpt-4.1-mini”
},
“options”: {}
},
“type”: “@n8n/n8n-nodes-langchain.lmChatOpenAi”,
“typeVersion”: 1.2,
“position”: [
-432,
240
],
“id”: “c047027a-e88b-4920-ad45-3fe922a1baae”,
“name”: “OpenAI Chat Model”,
“credentials”: {
“openAiApi”: {
“id”: “wbawuC0yQZ8tFz73”,
“name”: “OpenAi account”
}
}
},
{
“parameters”: {
“mode”: “retrieve-as-tool”,
“toolDescription”: “Use this database to give accurate information from this archive only. It contains information relating to Black health, history, business and social constructs.”,
“tableName”: {
“__rl”: true,
“value”: “documents”,
“mode”: “list”,
“cachedResultName”: “documents”
},
“topK”: 20,
“options”: {}
},
“type”: “@n8n/n8n-nodes-langchain.vectorStoreSupabase”,
“typeVersion”: 1.3,
“position”: [
384,
-48
],
“id”: “aabd9d54-1cdb-4403-8dc3-a2d375237fe1”,
“name”: “Archive_Knowledge_Base”,
“credentials”: {
“supabaseApi”: {
“id”: “hAAiZidosmsOJWU6”,
“name”: “Supabase-ASLLC”
}
}
},
{
“parameters”: {
“options”: {}
},
“type”: “@n8n/n8n-nodes-langchain.embeddingsOpenAi”,
“typeVersion”: 1.2,
“position”: [
416,
176
],
“id”: “e874d860-14ae-40b1-a9a0-aadbbd8d509f”,
“name”: “Embeddings OpenAI”,
“credentials”: {
“openAiApi”: {
“id”: “wbawuC0yQZ8tFz73”,
“name”: “OpenAi account”
}
}
},
{
“parameters”: {
“jsCode”: “return [\n {\n json: {\n tools: [\n {\n name: "ArchiveRetriever",\n description: "Retrieves information from the Archive Knowledge Base",\n execute: async (input) => {\n return "Fasting is a spiritual discipline practiced across cultures. It often symbolizes purification, self-control, and deeper connection to the divine.";\n }\n }\n ]\n }\n }\n];”
},
“type”: “@n8n/n8n-nodes-langchain.toolCode”,
“typeVersion”: 1.3,
“position”: [
48,
208
],
“id”: “33402e61-dcbf-4050-a29e-0b09ba3252a5”,
“name”: “Code Tool”
},
{
“parameters”: {
“jsCode”: “return [\n {\n json: {\n assistant_name: "Jabril",\n assistant_role: "Expert research assistant at the Black Civilization Research Archive"\n }\n }\n];”
},
“type”: “n8n-nodes-base.code”,
“typeVersion”: 2,
“position”: [
-672,
192
],
“id”: “ac04e230-ae75-44ff-b4d7-d264c08aa3cf”,
“name”: “Jabril Ai ID”
}
],
“pinData”: {},
“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
}
]
]
},
“Archive_Knowledge_Base”: {
“ai_tool”: [
[
{
“node”: “AI Agent”,
“type”: “ai_tool”,
“index”: 0
}
]
]
},
“Embeddings OpenAI”: {
“ai_embedding”: [
[
{
“node”: “Archive_Knowledge_Base”,
“type”: “ai_embedding”,
“index”: 0
}
]
]
},
“Code Tool”: {
“ai_tool”: [
[
{
“node”: “AI Agent”,
“type”: “ai_tool”,
“index”: 0
}
]
]
}
},
“active”: true,
“settings”: {
“executionOrder”: “v1”
},
“versionId”: “ac79a303-68b3-46d8-bfc8-f7c84fcdc0ef”,
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “7c3905c95976940f612570d815248ac422d15e48c627534201b878ff3a236e9c”
},
“id”: “EtjW7hOLafcEkaaQ”,
“tags”:
}!-- Hey! The fastest way to find solutions is by using the :magnifying_glass_tilted_right: search function at the upper right.
If your question hasn’t been asked before, please follow the template below. Skip the questions that are not relevant to you. →

Describe the problem/error/question

What is the error message (if any)?

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.