No session ID found when calling on other agents

Hello n8n community! :wave:

I’m encountering a persistent error when trying to use the LangChain Tool Workflow node to call a sub-workflow. I initially had memory-related errors, but now I’m getting a “Referenced node doesn’t exist” error. I’d love some guidance from anyone who has successfully implemented this pattern.

The Error

When executing my workflow, I get this error:

json

{
  "errorMessage": "Referenced node doesn't exist",
  "errorDetails": {},
  "n8nDetails": {
    "time": "5/21/2025, 5:29:53 PM",
    "n8nVersion": "1.90.2 (Cloud)",
    "binaryDataMode": "filesystem",
    "cause": {
      "executionId": "1602",
      "workflowId": "pYHGkQINJU42w9HS"
    }
  }
}

My Setup

I’m trying to build an AI agent with LangChain that uses tools implemented as sub-workflows. Here’s what I’ve tried so far:

  1. First, I set up a main workflow with a Chat Trigger node and a LangChain Tool Workflow node that calls another workflow.
  2. Initially, I encountered a “No session ID found” error in the “Simple Memory” node of my sub-workflow, which suggested I needed to pass the session ID to maintain conversation context.
  3. I then tried passing {{ $json.sessionId }} in the workflow inputs of my Tool Workflow node, but got a “Key parameter is empty” error.
  4. Now, the error has changed to “Referenced node doesn’t exist”.

What I’m Trying to Accomplish

I’m building an AI agent workflow where:

  • The main workflow receives user input via a Chat Trigger
  • It processes the input with LangChain (or Claude/GP
  • When specific tasks need to be performed, it calls specialized sub-workflows via the Tool Workflow node
  • These sub-workflows need to maintain memory/context between calls

Hello @Albert_Feldt, welcome to n8n community!


How do you actually pass {{ $json.sessionId }}? And what trigger type are you using in the sub-workflow?


Here’s my current approach:

In the sub-workflow, I set the trigger to “When Executed by Another Workflow” and define the Workflow Input Schema something like this:

Then, in the main workflow, you’ll notice that these fields are available for data input like the session or others:

Let me know if this works for you!

1 Like