Hello!
I have a Workflow that makes an HTTP Request call and GETs an Agent’s metadata.
With that metadata, the agent calls a new HTTP POST call to our server, in which the body of the POST call is filled in by the model. In the description I have provided the model with the schema it should follow. Our server requires the body to be application/json for an HTTP request. The model is able to successfully follow the schema, however, it always creates a Array when it should be creating a Object.
I am not sure, how to go about figuring this out. Since the Body of the HTTP call is filled in by the Agent, I keep running into errors when trying to set the Content Type or Specify Body as an Expression.
I have tried different variations such as
Body Content Type: RAW
Content Type: application/json
OR
Body Content Type: JSON
Specify Body: Using JSON
Here is part of the description, given to the Model:
{
“name”: “AGENT-IMPORTS-WORKFLOW-NAME-FROM-TOOL”,
“description”: “AGENT-CREATES-DESCRIPTION”,
…
“attributes”: {AGENT-FILLS-IN-FROM-TOOL}
}
Within the Agent System Message, I have written extensive information, guidelines, and proper formatting. The Agent seems to follow everything correctly, I think it is n8n related with JSON Arrays vs Objects.
Is there a better method of doing this? I am fairly new to n8n and experimenting with the platform. I am unable to share the link to my exact workflow due to company policy, can attach screenshots with some omitted information.
I am running n8n locally, version 1.109.2. Any help would be great!




