Error when using expression for URL parameter in HTTP Request Node

Hi all,
I am using an expression for the URL parameter in the HTTP Request node. The expression reads a value via the $node syntax. The expression is valid as I can see a valid URL when building the expression.

However, when executing the workflow, this step fails with the error ‘Error: options.uri is a required argument’. If I manually put the URL in, the node works as expected.

The expression is:
{{$node[“Config”].json[“config”][“parserXMLUrl”]}}

Where my Config node is a function node where I manually set some config values in the JSON to help during testing and development

I am running the latest version of n8n 0.123.1

Hey @IbnJubayr!

Thanks for the detailed explanation. Can you let us know if all the items in the output of the Function node contain parserXMLUri value? It would be helpful if you can share the output of the Function node. Please replace any sensitive information with some dummy data :slight_smile:

Hey,
The function node only has a single item as its the first node after start - is that the problem? Should I be referencing the specific index - seems obvious now!
The data from this node is not passed along the chain as I was expecting to just reference this node directly further down in the workflow

Are you using the Function node to simply set some values? If yes, you can use the Set node instead.

Should I be referencing the specific index - seems obvious now!

It is difficult to give a confirmation on this without knowing the data structure of the output.

Contents of the function node below.

items[0].json.config= {
  "parserXMLUrl": "https://mydomain.com/,
  "fromEmailAddress": "[email protected]",
  "errorEmailAddress": "[email protected]"
};
return items;

As mentioned, it it is the first node after start and I reference it directly much later in the workflow - these properties are no longer available on the input items hence the reason I try reference directly via $node

Thanks for sharing. To make sure I understand it correctly, your HTTP Request node is not directly connected with the Function node, there are other nodes in between.

If that’s the case you will have to use $item(0).$node["Config"].json["config"]["parserXMLUrl"]