I want to pass the full context (like user message and user ID) from one n8n agent to another, so the second agent can save all required data correctly in Supabase

Hi n8n Community,

I’m working on a workflow where the first agent receives an incoming request via a webhook. Depending on the type of request, this agent should then trigger a second agent to perform an action directly in Supabase (such as writing to a database), while the first agent still responds to the webhook.

The challenge I’m facing is how to pass the full context, including the original user message, user ID, and possibly other metadata, from the first workflow/agent to the second agent, so that the second agent knows what to do and can accurately write all required fields in Supabase.

Right now, I’m not sure:

  • How to transfer all relevant context/data between workflows or agents in n8n.
  • How to make sure the second agent receives all necessary information (e.g., user message, user ID) to fill out every field correctly in the Supabase table.

Does anyone have suggestions or examples for passing context/data like this between workflows or agents in n8n, especially so that the second agent can fully handle the Supabase insert with all needed details?

Thanks a lot!

Here is my workflow Code:
‘<{
“nodes”: [
{
“parameters”: {
“options”: {}
},
“type”: “n8n-nodes-base.respondToWebhook”,
“typeVersion”: 1.3,
“position”: [
340,
860
],
“id”: “ca60d371-e246-4600-974e-f905788019a9”,
“name”: “Respond to Webhook”
},
{
“parameters”: {
“httpMethod”: “POST”,
“path”: “18989786-ad93-4a9a-aa4d-e3e03da1999e”,
“responseMode”: “responseNode”,
“options”: {
“allowedOrigins”: “*”
}
},
“type”: “n8n-nodes-base.webhook”,
“typeVersion”: 2,
“position”: [
-780,
800
],
“id”: “a877aa95-da55-4656-a969-ff744e328998”,
“name”: “Webhook1”,
“webhookId”: “18989786-ad93-4a9a-aa4d-e3e03da1999e”
},
{
“parameters”: {
“model”: {
“__rl”: true,
“value”: “gpt-4-1106-preview”,
“mode”: “list”,
“cachedResultName”: “gpt-4-1106-preview”
},
“options”: {}
},
“type”: “@n8n/n8n-nodes-langchain.lmChatOpenAi”,
“typeVersion”: 1.2,
“position”: [
-440,
1080
],
“id”: “f588ac1b-c4ce-4705-ae1f-d9ace8fb7204”,
“name”: “OpenAI Chat Model1”,
“credentials”: {
“openAiApi”: {
“id”: “00o2G2HZmVv2mxKV”,
“name”: “[email protected]
}
}
},
{
“parameters”: {},
“type”: “@n8n/n8n-nodes-langchain.memoryBufferWindow”,
“typeVersion”: 1.3,
“position”: [
-180,
1080
],
“id”: “903ee6ba-c0d5-40c6-bb5b-0749000ed56a”,
“name”: “Simple Memory”
},
{
“parameters”: {
“options”: {
“systemMessage”: “Du bist der Operator-Agent in einem modularen KI-Coaching-System für Fußballspieler. Deine Aufgabe ist es, die eingehende Nutzereingabe zu analysieren und basierend auf dem Inhalt die passende Folgeaktion zu bestimmen.\n\nDein Ablauf besteht aus drei Schritten:\n\n1. Analyse der Nutzereingabe:\nBestimme, ob es sich bei der Anfrage um\n\neine individuelle Trainingseinheit handelt (z. B. „Ich möchte am Dienstagvormittag eine Einheit machen“)\n– oder um eine ganze Trainingswoche (z. B. „Bitte plane mir etwas für Montag, Mittwoch und Freitag“ oder „Ich habe diese Woche an 5 Tagen Zeit“).\n\nBeziehe dich dabei auf Begriffe wie konkrete Wochentage, Zeiträume (z. B. „diese Woche“) und Formulierungen wie „Plan“, „mehrere Tage“ oder „Einheiten“.\n\n2. Antwort an den User:\nSobald du erkannt hast, worum es geht, schicke eine neutrale, kurze Bestätigungsnachricht an den User zurück, z. B.:\n\nBei Einzel-Session:\n„Alles klar! Ich erstelle dir gleich eine Trainingseinheit für den gewünschten Zeitraum.“\n\nBei Wochenplan:\n„Super! Ich arbeite an einem kompletten Wochenplan basierend auf deinen Angaben.“\n\nDiese Nachricht soll den Nutzer beruhigen und dem UI ein direktes Feedback geben.\n\n3. Delegation an spezialisierte Agenten:\nLeite nun die Aufgabe an den entsprechenden spezialisierten Agenten weiter:\n\n"training_session_agent" → wenn es sich um eine einzelne Einheit handelt\n\n"training_plan_agent" → wenn ein ganzer Wochenplan gemeint ist\n\nÜbergib bei der Weiterleitung unbedingt:\n\ndie Originalnachricht\n\noptional extrahierte Informationen wie Wochentag(e), Zeitraum (AM/PM), Fokus\n\nDu selbst sollst keine Trainingspläne oder Übungen generieren – du bist nur für Entscheidung, User-Kommunikation und Agentenweiterleitung zuständig.\n\nFormat: Arbeite intern mit einem JSON-Objekt, z. B.:\n\njson\nKopieren\nBearbeiten\n{\n "type": "training_session" | "training_plan",\n "user_message": "Originale Nutzereingabe",\n "response_to_user": "Text für Sofortantwort im Chat",\n "dispatch_to": "training_session_agent" | "training_plan_agent"\n}\nAchte auf Klarheit, Robustheit und konsistente Logik – du bist der zentrale Dispatcher für die gesamte Trainingslogik.”
}
},
“type”: “@n8n/n8n-nodes-langchain.agent”,
“typeVersion”: 2,
“position”: [
-260,
760
],
“id”: “3e1fe887-7f58-4f61-b88e-835c576a4a75”,
“name”: “Operator Agent”
},
{
“parameters”: {
“workflowId”: {
“__rl”: true,
“value”: “FqS93KjSEGefVIZc”,
“mode”: “list”,
“cachedResultName”: “Soccerberg — Trainingsplaner”
},
“workflowInputs”: {
“mappingMode”: “defineBelow”,
“value”: {},
“matchingColumns”: ,
“schema”: ,
“attemptToConvertTypes”: false,
“convertFieldsToString”: false
}
},
“type”: “@n8n/n8n-nodes-langchain.toolWorkflow”,
“typeVersion”: 2.2,
“position”: [
280,
1120
],
“id”: “c9f94735-9f71-4c09-add1-eccf734ce6ce”,
“name”: “Call n8n Workflow Tool”
},
{
“parameters”: {
“options”: {}
},
“type”: “@n8n/n8n-nodes-langchain.chatTrigger”,
“typeVersion”: 1.1,
“position”: [
-760,
960
],
“id”: “2ee2df12-e455-4a63-9b2d-00c08870019c”,
“name”: “When chat message received”,
“webhookId”: “94d7b568-3a54-4994-9327-4f9f4b4616b3”
}
],
“connections”: {
“Webhook1”: {
“main”: [
[
{
“node”: “Operator Agent”,
“type”: “main”,
“index”: 0
}
]
]
},
“OpenAI Chat Model1”: {
“ai_languageModel”: [
[
{
“node”: “Operator Agent”,
“type”: “ai_languageModel”,
“index”: 0
}
]
]
},
“Simple Memory”: {
“ai_memory”: [
[
{
“node”: “Operator Agent”,
“type”: “ai_memory”,
“index”: 0
}
]
]
},
“Operator Agent”: {
“main”: [
[
{
“node”: “Respond to Webhook”,
“type”: “main”,
“index”: 0
}
]
]
},
“Call n8n Workflow Tool”: {
“ai_tool”: [
[
{
“node”: “Operator Agent”,
“type”: “ai_tool”,
“index”: 0
}
]
]
},
“When chat message received”: {
“main”: [
[
{
“node”: “Operator Agent”,
“type”: “main”,
“index”: 0
}
]
]
}
},
“pinData”: {},
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “e76c23481e53eb13c8c1c152625296933d9c1cb05b9a78fe982e4dc47fce9a8e”
}
}>’