I’m currently building an AI Agent workflow in n8n to retrieve tasks from a Notion database, filtered by project. The agent should allow users to ask questions like:
“What are the open tasks for the project ‘Webseiten’?”
The goal is that the AI interprets this input, identifies the project name (“Webseiten”), looks up the corresponding Notion page ID (via a custom tool called Get Project Page ID), and uses that ID to search for tasks in the Tasks DB (via a tool called Search inside Task DB).
All tools are connected properly, and the agent has access to the required memory, tools, and output parser. The logic inside the system prompt is well-defined and works when tested manually. Here’s how it’s structured in the prompt:
- Detect project names and retrieve the project ID using the tool Get Project Page ID.
- Pass the resulting ID to the tool Search inside Task DB, alongside a “done” status and optional deadline filters.
- Output a structured task list with titles, deadlines, project relation, etc.
Despite this logic working conceptually, I’m running into a critical issue:
Problem
The AI Agent does not pass any data into the Get Project Page ID tool.
Although the user input clearly contains the project name (“Webseiten”), the tool receives an empty input object ({}
), and the internal expression {{ $json.project }}
evaluates to undefined
. As a result, the Project ID can’t be resolved, and all subsequent tools fail due to missing required filters (e.g. project_id
).
My body for Http request: get project page ID:
{
“filter”: {
“property”: “Projektname”,
“rich_text”: {
“contains”: “{{ $json.project }}”
}
}
}
What I expect
I would expect the AI Agent to:
- Parse the user message correctly.
- Extract the project name (“Webseiten”).
- Use the Get Project Page ID tool and pass
{ "project": "Webseiten" }
as input. - Receive the correct page ID.
- Pass that ID into Search inside Task DB with the proper filter.
However, step 3 never happens because the input is missing entirely — even though it’s clearly required by the system prompt and mentioned in the user input.
My questions
- Is this a bug or known limitation in how tools get called and filled via the AI Agent node?
- Do I need to use special variable names or mappings to ensure the input gets passed?
- Do I have to pre-declare the variable (e.g.
project
) elsewhere in the flow?
Any insights from the community would be super helpful, as this seems like a blocker for enabling more powerful, AI-driven workflows with tool chaining.
Information on my n8n setup
- n8n version: 1.44.1 (n8n Cloud)
- Database: Default (SQLite)
- Execution Mode: own
- Running via: n8n Cloud
- Operating System: macOS (development), cloud-hosted (execution)
it is working that it shows me the open tasks of the database:
but the problem is that it is not applying the filter for search and the input is empty for “get project page id”