Using Http Request node's output

Hi guys,

I know the output of a HTTP Request node is available to the next node.

But is it possible to use the output like below

for example, output of HTTP Request node was

{
  "id": "1234",
  "someKey": "someVal"
}

Now in a function node that comes after the above HTTP Request node. I want to do something like

{
   "newVar": "123",
   "test": <use HTTP Request Node output here>
}

so that the final output is something like

{
   "newVar": "123",
   "test": {
     "id": "1234",
     "someKey": "someVal"
   }
}

is that possible?

this is a POST request btw, iā€™m trying to use the response that I received from a POST request.

Answering my own question for anyone coming here with the same query.

you can access it like so.

if you want to access it from a function node ā†’ $node["<Name of the HTTP Request Node>"].json

if you want to access it as an expression ā†’ {{$node["<Name of the HTTP Request Node>"].json}}

2 Likes

Those are expressions. You can information about it in the link below:

https://docs.n8n.io/nodes/expressions.html#expressions

1 Like