Hi Nicholas, good. What you want to do it is perfectly achievable and can be automated by using the Admin API that Node-RED provides. This API that allows developers to read, modify and delete flows (and nodes, modules and probably projects too).
This is the link to the API documentation: Admin API Methods : Node-RED
The flow I posted before uses the Admin API to read the active flow configuration file and filter only the information for the existing http request
nodes (or return undefined if the flow does not have a node of this kind). By automating the search you will not need to manually search nodes with control + f
I modified the previous flow to export the list of node id´s and URLs to a CSV file. There will be a row in the CSV file for each http request
from your current flow.
Flow to import and test (please ask for help if you are not sure how to import flows)
[{"id":"7491b1e6.7a10a","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"975eafc1.cf024","type":"change","z":"7491b1e6.7a10a","name":"jsonata filter","rules":[{"t":"set","p":"filter","pt":"msg","to":"payload[type = 'http request'].{\"id\": id, \"url\":url}","tot":"jsonata"},{"t":"set","p":"payload","pt":"msg","to":"filter","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":140,"wires":[["27a1a600.86319a","8a0cf58f.769318"]]},{"id":"4f298fb6.c7d64","type":"inject","z":"7491b1e6.7a10a","name":"Go","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":130,"y":140,"wires":[["9910bde3.9837"]]},{"id":"27a1a600.86319a","type":"debug","z":"7491b1e6.7a10a","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":590,"y":200,"wires":[]},{"id":"9910bde3.9837","type":"http request","z":"7491b1e6.7a10a","name":"Get flows","method":"GET","ret":"obj","paytoqs":false,"url":"http://localhost:1880/flows","tls":"","proxy":"","authType":"basic","x":260,"y":140,"wires":[["975eafc1.cf024"]]},{"id":"9ec62ffd.1158b","type":"file","z":"7491b1e6.7a10a","name":"Write filter","filename":"C:\\Users\\OCM\\.node-red\\static\\nrfiles\\filter-flow.csv","appendNewline":true,"createDir":false,"overwriteFile":"false","encoding":"none","x":720,"y":140,"wires":[[]]},{"id":"8a0cf58f.769318","type":"csv","z":"7491b1e6.7a10a","name":"","sep":",","hdrin":"","hdrout":true,"multi":"one","ret":"\\r\\n","temp":"id,url","skip":"0","x":590,"y":140,"wires":[["9ec62ffd.1158b"]]}]
You will need to modify the configuration of two nodes to suit your system.
1- modify the config for the Get flows
node so that the URL in the dialog panel will point to your Node-RED instance (but keep the /flows
in the URL string).
2- Modify the path and the file name for the Write filter
node.