I have a list of URLs and I want to make an HTTP request on each URL to then use the results in other areas of my workflow. Is that something that N8N can handle? If so, how would I go about it?
that can be easily done using the HTTP Request node.
I created a sample workflow using an expression to bind the incoming urls.
I am having issues when running this node setup.
If I run one url it works but as soon as I add the second url it fails
NodeApiError: UNKNOWN ERROR - check the detailed error for more information at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/nodes/HttpRequest/HttpRequest.node.ts:1250:12) at runMicrotasks (<anonymous>) at processTicksAndRejections (node:internal/process/task_queues:96:5) at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/src/Workflow.ts:1316:19) at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/src/WorkflowExecute.ts:949:29
sorry to hear you are having trouble. This seems like a different problem, apparently you are setting an invalid header value. Can you maybe share your workflow here? You just have to select all nodes and copy/paste the json here, ideally wrap it in three backticks
Please make sure you don’t share any sensitive information on the forum, you can replace those with dummy values.
Thank You for your reply my workflow has admin password and api key the first to nodes are doing the auth for api key and in the function I have added the websites the Last node just copies the auth token from the Request_For_Authkey and calls the url if I use one url it works but as soon as I add the second one it fails.
So in my case I have to cal the API first to obtain special username then second http will add the OTP with the special username and give me the Auth Token third Http is using the Auth token to get the data but I have multiple url with different data to be pulled so that is why I was trying to use the function it works with one url but if I add the second one it falis.
This the link for the API call ManageEngine Endpoint Central API
Hmmm, that sounds strange Let’s try something out.
Can you try only executing your second url to make sure the second url itself actually works?
Yes, I did one url each time with different value at the end and it works with one url but as soon as I add second one it gives that error.
I can take any url from the link I sent you and call the api but only single url will work not multiple.
Ok good. This is hard for me to debug since i cannot see your workflow. Can you make screeshots from the expressions that you are using to set the headers? Even better would be if you post your workflow with all sensitive information replaced with dummy values.
Dose this help
Yes this helps, thanks a lot. I think i see the problem. The expression you are using for your header value should be this:
$item(0) at the beginning will make sure to always use the first response from
Request_For_AuthKey, also for your 2nd and 3rd url. Internally n8n will use something we call a runIndex, so for your second url it will try to load the second
Request_For_AuthKey, which does not exist.
So you workflow should look like this.
Does this work for you?
Thank you so much! That worked splendidly for what I needed.