Hi everyone,
I’m encountering an issue while linking two AI agents in n8n.
Here’s the setup:
I have a main agent designed to provide complex reasoning based on data from two Google Sheets.
I built two specialized sub-agents, each responsible for retrieving relevant information from one of the sheets:
Sheet 1: Our internal processes
Sheet 2: Tool features (both new and legacy)
The goal is for the main agent to determine which tool best fits a given process. However, the main agent is unable to trigger or retrieve results from the two sub-agents.
Here are the error messages I’m getting:
"undefined" is not valid JSON
Error in sub-node Simple Memory (No session ID found)
For now, I’ve only built one sub-agent workflow, since it’s not working and I wanted to solve the issue before duplicating it.
Here is the workflow :
{
“nodes”: [
{
“parameters”: {},
“type”: “n8n-nodes-base.manualTrigger”,
“typeVersion”: 1,
“position”: [
0,
0
],
“id”: “c8992c7f-525f-4c97-8ab5-68cd2762996a”,
“name”: “When clicking ‘Execute workflow’”
},
{
“parameters”: {
“options”: {}
},
“type”: “@n8n/n8n-nodes-langchain.chatTrigger”,
“typeVersion”: 1.1,
“position”: [
0,
200
],
“id”: “799081b2-e2ea-4e4f-b392-316f3d06670a”,
“name”: “When chat message received”,
“webhookId”: “2fa4a7ad-5170-4e02-80cc-7b72ceee88c2”
},
{
“parameters”: {
“options”: {}
},
“type”: “@n8n/n8n-nodes-langchain.agent”,
“typeVersion”: 2,
“position”: [
440,
0
],
“id”: “08df7721-3534-4d04-bb53-30697e275cdc”,
“name”: “AI Agent”,
“notes”: “Voici l’ID du google sheet ou se trouvent les offres d’emplois et leurs informations associées : 1Ds62I8P6kQV77Kl4P_S10RJ1ALWz3ClbEIeF83Jrjk0\n\nPour trouver \n”
},
{
“parameters”: {
“modelName”: “models/gemini-2.5-pro-preview-06-05”,
“options”: {}
},
“type”: “@n8n/n8n-nodes-langchain.lmChatGoogleGemini”,
“typeVersion”: 1,
“position”: [
420,
220
],
“id”: “f5716b5a-0488-41c1-9510-fa087c7f3c80”,
“name”: “Google Gemini Chat Model”,
“credentials”: {
“googlePalmApi”: {
“id”: “zSz3lWl1pMzh9CIq”,
“name”: “Google Gemini(PaLM) Api account”
}
},
“notes”: “Voici l’ID du google sheet ou se trouvent les offres d’emplois et leurs informations associées : 1Ds62I8P6kQV77Kl4P_S10RJ1ALWz3ClbEIeF83Jrjk0\n\nToutes les offres sont listées dans la feuille "Sheet 1"”
},
{
“parameters”: {
“contextWindowLength”: 1000
},
“type”: “@n8n/n8n-nodes-langchain.memoryBufferWindow”,
“typeVersion”: 1.3,
“position”: [
540,
220
],
“id”: “20aac580-2b15-478e-b907-ed02424c45fd”,
“name”: “Simple Memory”
},
{
“parameters”: {
“description”: “=Tu es un sous agent dont le rôle est de chercher des informations dans un fichier google sheet afin de les stocker et envoyer à d’autres agents N8N.”,
“workflowId”: {
“__rl”: true,
“value”: “gvjcXfsSBJwiPl8T”,
“mode”: “list”,
“cachedResultName”: “Agent Gsheet Offres Client”
},
“workflowInputs”: {
“mappingMode”: “defineBelow”,
“value”: {},
“matchingColumns”: ,
“schema”: ,
“attemptToConvertTypes”: false,
“convertFieldsToString”: false
}
},
“type”: “@n8n/n8n-nodes-langchain.toolWorkflow”,
“typeVersion”: 2.2,
“position”: [
720,
220
],
“id”: “42376197-557c-4b25-b891-77e4e1e963f2”,
“name”: “Agent Gsheet Offres Client”
}
],
“connections”: {
“When clicking ‘Execute workflow’”: {
“main”: [
[
{
“node”: “AI Agent”,
“type”: “main”,
“index”: 0
}
]
]
},
“When chat message received”: {
“main”: [
[
{
“node”: “AI Agent”,
“type”: “main”,
“index”: 0
}
]
]
},
“Google Gemini Chat Model”: {
“ai_languageModel”: [
[
{
“node”: “AI Agent”,
“type”: “ai_languageModel”,
“index”: 0
}
]
]
},
“Simple Memory”: {
“ai_memory”: [
[
{
“node”: “AI Agent”,
“type”: “ai_memory”,
“index”: 0
}
]
]
},
“Agent Gsheet Offres Client”: {
“ai_tool”: [
[
{
“node”: “AI Agent”,
“type”: “ai_tool”,
“index”: 0
}
]
]
}
},
“pinData”: {},
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “04d0c009654083fda510793e1f8ab9bd7f072c63aec69c2bdedda5ea3eb2217e”
}
}
There is no output as the AI agent can’t process the data.
But the output should be text information,
Information on your n8n setup
- n8n version: free trial
- Database : SQLite
- n8n EXECUTIONS_PROCESS setting default: own, main
- Running n8n via : n8n cloud
- Operating system: No idea tbh