How to add a previous http node response to new http node request?
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:
To add a previous HTTP node response to a new HTTP request:
- In your new HTTP Request node, use expressions to reference the previous node’s data:
- For body data:
Body Type: JSON
JSON Body: {{$node["Previous HTTP Node"].json}}
- For specific fields:
text
{"key": "{{$node["Previous HTTP Node"].json.specificField}}"}
- For query parameters:
Add Parameter:
Name: paramName
Value: {{$node["Previous HTTP Node"].json.paramValue}}
- For headers:
Add Header:
Name: X-Custom-Header
Value: {{$node["Previous HTTP Node"].json.headerValue}}
Adjust the field names and structure based on your specific previous HTTP response.
If my solution helped you, please consider marking it as the answer! A like would brighten my day if you found it useful!
One more thing, I have 4 http tool nodes which are connected with AI agent and 3 of the http request tool nodes responses will be in add to the 4th json body.
Image attached for better understanding,
Josn body of 4th node:
{
“TxnDate”: “{txn_date}”,
“DueDate”: “{due_date}”,
“SalesTermRef”: {
“value”: “{{ $(“term_detail_from_quickbook”).isExecuted ? $node[“term_detail_from_quickbook”].json.QueryResponse?.Term[0]?.Id : “”}}”,
“name”: “{{ $(“term_detail_from_quickbook”).isExecuted ? $node[“term_detail_from_quickbook”].json.QueryResponse?.Term[0]?.Name : ‘’ }}”
},
“ApplyTaxAfterDiscount”:{tax_included == “YES” ? true : false},
“Line”: [
{
“DetailType”: “SalesItemLineDetail”,
“Amount”: {amount},
“SalesItemLineDetail”: {
“ServiceDate”: “{service_date}”,
“ItemRef”: {
“name”: “{{ $(“item_detail_from_quickbook”).isExecuted ? $node[“item_detail_from_quickbook”].json?.QueryResponse?.Item[0]?.Name : ‘’ }}”,
“value”: “{{ $(“item_detail_from_quickbook”).isExecuted ? $node[“item_detail_from_quickbook”].json?.QueryResponse?.Item[0]?.Id : ‘’ }}”
},
“Qty”: “{quantity}”,
“UnitPrice”: {rate}
}
}
],
“CustomField”: [
{
“DefinitionId”: “1”,
“Name”: “TRN”,
“Type”: “StringType”,
“StringValue”: “001-726-455”
}
],
“CustomerRef”: {
“value”: “{{ $(“customer_detail_from_quickbook”).isExecuted ? $node[“customer_detail_from_quickbook”].json?.QueryResponse?.Customer[0]?.Id : ‘’ }}”
}
}
- Do you need to preserve all data from previous calls or just specific fields?
Just specific field
I think this should solve your problem of just sending one data to the AI Agent,
If my solution helped you, please consider marking it as the answer! A like would brighten my day if you found it useful!
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.