Can’t get data for expression when i try to make a post from http request node
If I sent hard data. it works ok. but if I recieve from anther node, the input is correct, but the data sent is empty
Hi, so if I read it correctly the problem only occurs when input data is coming from another node. Perhaps the issue is with the data structure or used expression, maybe it is something specific to the API you are calling. It is difficult to say more at this point. Can you share more details? a screenshot of your workflow, the data sample coming from a node to your http request node, the output or error message you get from the http node (expected vs actual), the expression you used to pass custom data to the request.
Can you please share the workflow? It definitely has something to do with the incoming data values and readability but it is hard to say what’s the issue exactly when their is no workflow to look at.
thanks for including screenshots!
So, as I can see on the http request node, you are trying to post data to your localhost:3000. This will work only if your n8n is also hosted locally (localhost will point to your local machine). It will fail if you are using cloud service or running the tool in Docker - in these cases localhost is the server the cloud runs on or the docker container.
If you do not want to move to localhost version of n8n, for testing you can use ngrok to expose your api to web: install ngrok and then run ngrok http 3000, you will receive a temporary url you can use in the http request node to call your api. For long term solutions you might have to explore other options up to deploying your API.
Thank you for your response. I will try to be clearer. I am targeting my local machine as I am testing.
The flow starts in a previous workflow with an AI agent.
In this workflow, I receive the data and want the HTTP node to insert it into the database.
If I put hard data into the HTTP node, the data is correctly inserted into the final database through the API.
The general idea is to tell an LLM something like, “Please create and insert 20 people with random data.”
From WA (workflowA) to WB, the data goes well. It even enters the http node input correctly (as can be seen in the image). But for some reason, it does not recognize the json variables and always reaches the API with empty parameters.
I have tried a thousand different ways.
{{ $json.name }} {{ $item.json.name }} {{ $query.name }} , etc., etc., etc.
Thank you for your response. I will try to be clearer. I am targeting my local machine as I am testing.
The flow starts in a previous workflow with an AI agent.
In this workflow, I receive the data and want the HTTP node to insert it into the database.
If I put hard data into the HTTP node, the data is correctly inserted into the final database through the API.
The general idea is to tell an LLM something like, “Please create and insert 20 people with random data.”
From WA (workflowA) to WB, the data goes well. It even enters the http node input correctly (as can be seen in the image). But for some reason, it does not recognize the json variables and always reaches the API with empty parameters.
I have tried a thousand different ways.
{{ $json.name }} {{ $item.json.name }} {{ $item.json.fields.name }} {{ $query.name }} , etc., etc., etc.
the incoming data is not the valid JSON, the escape characters (“\”) are messing it up so everything after “query” is one long string. You might want to update your prompt to have the model validate that before creating output, best on an example. Then the “{{ $json.query.nombre }}” should work just fine ![]()
This is because the query variable you are receiving is not a JSON but a string with escape characters. You need to specify in the subworkflow, the exact variables you need there and map those from your other flow to this one. That’s a very common problem when dealing with sub-workflows.
If you still do not understand and need help with that, please share the exact workflows and I can help you map that.
thanks !! That was the problem. I thought it was just a matter of it not looking nice. But in reality, it was a string. I solved it with a “code” node in the middle that takes the string and returns the JSON correctly.![]()
Happy to help ![]()
If it resolved the issue, please mark the response as the solution. Cheers!

