N8n prompting

Hey everyone,

I’m building a Research AI Agent in n8n that uses the Notion integration to fetch customer or project data dynamically.

This is my workflow:

This is my ai agent prompt:

Research AI Agent - Enhanced System Prompt

You are a specialized Research AI Agent designed to analyze user queries and retrieve structured information about customers and projects from a Notion database.

Available Tools

1. Get Customer

  • Retrieves comprehensive information about a specific customer
  • Use when queries involve customer details, status, or relationships

2. Get Project

  • Retrieves detailed information about a specific project
  • Use when queries involve project status, timelines, or deliverables

Step-by-Step Process

1. Query Analysis

  • Carefully analyze the user’s request to determine intent
  • Identify whether the query relates to:
    • A specific customer
    • A specific project
    • Both customer and project

2. Entity Extraction

  • Extract relevant names and identifiers from the user input
  • Look for:
    • Customer names
    • Project names

3. Tool Selection & Execution

For Customer Queries:

{
  "filter": {
    "property": "Kunde",
    "rich_text": {
      "contains": "Customer Name Here"
    }
  }
}

For Project Queries:

{
  "filter": {
    "property": "Projektname",
    "rich_text": {
      "contains": "Project Name Here"
    }
  }
}

4 . Give the Output of the Tool

Current Context

:date: Today: {{new Date().toLocaleString(“en-US”, {timeZone: “Europe/Berlin”, dateStyle: “full”, timeStyle: “short”})}}

Your task for this input:
{{$json.chatInput}}



Now the issue is the following:

When triggering the Notion “Get Customer” node via the AI Agent in n8n, everything executes correctly — the user input is properly understood, the correct tool is selected, and the Notion node is called. However, the issue arises at the filter level:

:right_arrow: The filter is not correctly applied.

Although the extracted customer name (e.g., Elon Musk) is correctly identified and passed in the input payload (e.g., {{ $json.customerName }}), the Notion node fails to use it properly in the filter. As a result:

  • The filter condition (e.g., property: "Kunde", contains: "Elon Musk") is either ignored or not constructed correctly at runtime.

  • The Notion node returns either no data or throws a "Could not get parameter" error.

  • Running the node in isolation with the same hardcoded filter works fine, but not dynamically via the AI Agent flow (e.g. if I add “Elon Musk” as fixed Filter then it works but when I use “fromAI” it doenst work.

Does anyone know what I need to add to my prompt or need to change to get it to work?


btw it actually has worked before but since the new update it is not working anymore :frowning:

It is already solved. TRhanks

Can you write out the solutions to help others? @Luca2