Hi everyone,
I’m currently building a Notion automation in n8n using the AI Agent, and I’ve run into a problem. The idea is simple: I want to create a new task in a Notion database and automatically link it to an existing customer via a relation field. The task creation is triggered by a natural language message like “Create a task for the website project with customer Elon Musk.”
In notion I have two databases: Task Database and Customer Database. I already managed that it is creating tasks into my Task Database. But the problem is that I do not know how to add the customer into the task via relation field.
I tried using the “Get database page” action in n8n, but that only works if I already have the full page ID or exact URL. There doesn’t seem to be a native way to perform a fuzzy or partial match like “find the customer whose name contains ‘Elon’”.
What I want to do is: parse the name from the initial message (e.g. “Elon” is the customer), search the customer database for the most similar or matching entry (e.g. “Elon Musk”), retrieve the correct page ID, and use that to populate the relation field in the task database.
My question is: how can I solve this within n8n? Is there a way to search a Notion database for a partial name or similar string and retrieve the corresponding page ID?
Any help or suggestions would be highly appreciated!


