Issue Parsing Inbound JSON - Tools

Hello - I’m trying to use an N8N workflow as a referenced tool in an AI Agent I’m building. I’ve configured the agent to send the flow email contact and context info in the following schema (example):

{
"recipient":"John Doe",
"address":"[email protected]",
"context":"I am reaching out to inquire about your availability for a meeting next week. Please let me know when you are free to discuss further. Thank you."}"

When I run the agent, it creates a ‘query’ wrapper around the json payload and sends it as such:

[
{
"query": 
"{"recipient":"John Doe","address":"[email protected]","context":"I am contacting you to inquire about your availability for a call next week. Please let me know the dates and times that work best for you. Thank you."}"
}
]

Now, when I go into the config for the tool and use an edit fields node to extract the fields from the JSON payload it’s not recognizing the field addresses. I could use some help generating the correct syntax for the field address formula in the edit fields node.

Currently I’m using the following for each:

recipient: {{ $json.query.recipient }}
address: `{{ $json.query.address }}
context: {{ $json.query.context }}

But as you can see in the screenshot it is not picking up any of these values. Any help is much appreciated!

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

@cs_lec , the value of query is the string, not object. Therefore, you cannot reference the properties with dot-notation. You need to convert the string to object first as shown below.

See the difference in the screenshot

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.