How to using http request for this case

Hi,
I have a Data folder containing zip files:
http-request-break-5
Files data: C:\Temp\Data

and 2 processing flows called Flow1 and Flow2:
■Flow1 will take care of moving all the zip files to the Move, Backup folder

[{"id":"8ede64fb.c4f9a8","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"b99f1fd5.ac5db","type":"http in","z":"8ede64fb.c4f9a8","name":"","url":"/GetData1","method":"get","upload":false,"swaggerDoc":"","x":200,"y":140,"wires":[["8d95e31a.ac64"]]},{"id":"d049b738.0e79d8","type":"http response","z":"8ede64fb.c4f9a8","name":"http response","statusCode":"","headers":{},"x":720,"y":440,"wires":[]},{"id":"6a09ba08.5442b4","type":"switch","z":"8ede64fb.c4f9a8","name":"i<msg.files.length","property":"i","propertyType":"msg","rules":[{"t":"lt","v":"files.length","vt":"msg"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":350,"y":380,"wires":[["b40c4912.87afd8"],["11709bf3.dbf504"]]},{"id":"bdd6220f.6f0de","type":"debug","z":"8ede64fb.c4f9a8","name":"msg flow 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":710,"y":480,"wires":[]},{"id":"f2551b2.e61f9e8","type":"switch","z":"8ede64fb.c4f9a8","name":"if i = 5","property":"i","propertyType":"msg","rules":[{"t":"eq","v":"5","vt":"num"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":970,"y":380,"wires":[["cd83dc80.3c09d"],["f0925530.f19478"]]},{"id":"651aa1b0.6dfc3","type":"change","z":"8ede64fb.c4f9a8","name":"i=0","rules":[{"t":"set","p":"i","pt":"msg","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":510,"y":140,"wires":[["6a09ba08.5442b4"]]},{"id":"6593be1f.f3624","type":"change","z":"8ede64fb.c4f9a8","name":"i++","rules":[{"t":"set","p":"i","pt":"msg","to":"$.i + 1\t","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":970,"y":140,"wires":[["6a09ba08.5442b4"]]},{"id":"8d95e31a.ac64","type":"fs-ops-dir","z":"8ede64fb.c4f9a8","name":"","path":"C:\\Temp\\Data","pathType":"str","filter":"*","filterType":"str","dir":"files","dirType":"msg","x":360,"y":140,"wires":[["651aa1b0.6dfc3"]]},{"id":"11709bf3.dbf504","type":"http request","z":"8ede64fb.c4f9a8","name":"","method":"GET","ret":"txt","paytoqs":true,"url":"http://localhost:1880/ProcessData","tls":"","proxy":"","authType":"","x":530,"y":440,"wires":[["d049b738.0e79d8","bdd6220f.6f0de"]]},{"id":"a560ae9f.b911d","type":"delay","z":"8ede64fb.c4f9a8","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1100,"y":440,"wires":[["cd83dc80.3c09d"]]},{"id":"cd83dc80.3c09d","type":"fs-ops-move","z":"8ede64fb.c4f9a8","name":"","sourcePath":"C:\\Temp\\Data","sourcePathType":"str","sourceFilename":"fileMoved","sourceFilenameType":"msg","destPath":"C:\\Temp\\Data\\Move","destPathType":"str","destFilename":"fileMoved","destFilenameType":"msg","link":false,"x":1260,"y":440,"wires":[["6593be1f.f3624"]]},{"id":"f0925530.f19478","type":"fs-ops-move","z":"8ede64fb.c4f9a8","name":"","sourcePath":"C:\\Temp\\Data","sourcePathType":"str","sourceFilename":"fileMoved","sourceFilenameType":"msg","destPath":"C:\\Temp\\Data\\Move","destPathType":"str","destFilename":"fileMoved","destFilenameType":"msg","link":false,"x":1100,"y":320,"wires":[["6593be1f.f3624"]]},{"id":"b40c4912.87afd8","type":"change","z":"8ede64fb.c4f9a8","name":"","rules":[{"t":"set","p":"fileMoved","pt":"msg","to":"$.files[$$.i]","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":320,"wires":[["549d105a.50198"]]},{"id":"549d105a.50198","type":"fs-ops-type","z":"8ede64fb.c4f9a8","name":"","path":"C:\\Temp\\Data","pathType":"str","filename":"fileMoved","filenameType":"msg","filetype":"type","filetypeType":"msg","x":720,"y":320,"wires":[["e32832a9.87d4d"]]},{"id":"e32832a9.87d4d","type":"switch","z":"8ede64fb.c4f9a8","name":"","property":"type","propertyType":"msg","rules":[{"t":"eq","v":"F","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":850,"y":320,"wires":[["f2551b2.e61f9e8"],["6593be1f.f3624"]]},{"id":"cb786826.935e48","type":"http in","z":"8ede64fb.c4f9a8","name":"","url":"/GetData","method":"get","upload":false,"swaggerDoc":"","x":190,"y":760,"wires":[["81bd6713.7351e8"]]},{"id":"3e9bd2a0.f949be","type":"http response","z":"8ede64fb.c4f9a8","name":"http response","statusCode":"","headers":{},"x":540,"y":1040,"wires":[]},{"id":"2d56bdb2.3da4d2","type":"switch","z":"8ede64fb.c4f9a8","name":"i<msg.files.length","property":"i","propertyType":"msg","rules":[{"t":"lt","v":"files.length","vt":"msg"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":350,"y":1000,"wires":[["590e3063.b20c5"],["3e9bd2a0.f949be"]]},{"id":"c940907.375037","type":"switch","z":"8ede64fb.c4f9a8","name":"","property":"i","propertyType":"msg","rules":[{"t":"lt","v":"5","vt":"num"},{"t":"eq","v":"5","vt":"num"},{"t":"eq","v":"6","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":4,"x":830,"y":1140,"wires":[["9e82c32f.cdd"],["dbe492a1.ec36c"],["ff3da480.478fd8"],["1c1068d9.9a9827"]]},{"id":"de029ce1.0d84d","type":"change","z":"8ede64fb.c4f9a8","name":"i=0","rules":[{"t":"set","p":"i","pt":"msg","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":510,"y":760,"wires":[["2d56bdb2.3da4d2"]]},{"id":"d6c57808.d043a8","type":"change","z":"8ede64fb.c4f9a8","name":"i++","rules":[{"t":"set","p":"i","pt":"msg","to":"$.i + 1\t","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1130,"y":760,"wires":[["2d56bdb2.3da4d2"]]},{"id":"81bd6713.7351e8","type":"fs-ops-dir","z":"8ede64fb.c4f9a8","name":"","path":"C:\\Temp\\Data","pathType":"str","filter":"*","filterType":"str","dir":"files","dirType":"msg","x":360,"y":760,"wires":[["de029ce1.0d84d"]]},{"id":"ff3da480.478fd8","type":"delay","z":"8ede64fb.c4f9a8","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1000,"y":1180,"wires":[["f6094a6f.38e048"]]},{"id":"f6094a6f.38e048","type":"fs-ops-move","z":"8ede64fb.c4f9a8","name":"","sourcePath":"C:\\Temp\\Data","sourcePathType":"str","sourceFilename":"fileMoved","sourceFilenameType":"msg","destPath":"C:\\Temp\\Data\\Backup","destPathType":"str","destFilename":"fileMoved","destFilenameType":"msg","link":false,"x":1300,"y":1180,"wires":[["d6c57808.d043a8"]]},{"id":"9e82c32f.cdd","type":"fs-ops-move","z":"8ede64fb.c4f9a8","name":"","sourcePath":"C:\\Temp\\Data","sourcePathType":"str","sourceFilename":"fileMoved","sourceFilenameType":"msg","destPath":"C:\\Temp\\Data\\Move","destPathType":"str","destFilename":"fileMoved","destFilenameType":"msg","link":false,"x":1000,"y":1060,"wires":[["d6c57808.d043a8"]]},{"id":"590e3063.b20c5","type":"change","z":"8ede64fb.c4f9a8","name":"","rules":[{"t":"set","p":"fileMoved","pt":"msg","to":"$.files[$$.i]","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":960,"wires":[["117955ae.da110a"]]},{"id":"117955ae.da110a","type":"fs-ops-type","z":"8ede64fb.c4f9a8","name":"","path":"C:\\Temp\\Data","pathType":"str","filename":"fileMoved","filenameType":"msg","filetype":"type","filetypeType":"msg","x":720,"y":960,"wires":[["f1b91f73.ab03e"]]},{"id":"f1b91f73.ab03e","type":"switch","z":"8ede64fb.c4f9a8","name":"","property":"type","propertyType":"msg","rules":[{"t":"eq","v":"F","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":850,"y":960,"wires":[["c940907.375037"],["d6c57808.d043a8"]]},{"id":"dbe492a1.ec36c","type":"fs-ops-move","z":"8ede64fb.c4f9a8","name":"","sourcePath":"C:\\Temp\\Data","sourcePathType":"str","sourceFilename":"fileMoved","sourceFilenameType":"msg","destPath":"C:\\Temp\\Data\\Move","destPathType":"str","destFilename":"fileMoved","destFilenameType":"msg","link":false,"x":1000,"y":1120,"wires":[["31b515cd.4d1dfa"]]},{"id":"31b515cd.4d1dfa","type":"http request","z":"8ede64fb.c4f9a8","name":"","method":"GET","ret":"txt","paytoqs":true,"url":"http://localhost:1880/ProcessData","tls":"","proxy":"","authType":"","x":1190,"y":1120,"wires":[["d6c57808.d043a8"]]},{"id":"1c1068d9.9a9827","type":"fs-ops-move","z":"8ede64fb.c4f9a8","name":"","sourcePath":"C:\\Temp\\Data","sourcePathType":"str","sourceFilename":"fileMoved","sourceFilenameType":"msg","destPath":"C:\\Temp\\Data\\Backup","destPathType":"str","destFilename":"fileMoved","destFilenameType":"msg","link":false,"x":1000,"y":1240,"wires":[["d6c57808.d043a8"]]}]

■Flow2 will output the ListData.txt file containing the names of the zip files in the Move folder

[{"id":"f9f46c0f.0b6ee","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"a11424c6.3c4888","type":"http in","z":"f9f46c0f.0b6ee","name":"","url":"/ProcessData","method":"get","upload":false,"swaggerDoc":"","x":210,"y":140,"wires":[["7e99fcd4.5d19e4"]]},{"id":"f239ecd2.53cbb","type":"http response","z":"f9f46c0f.0b6ee","name":"http response","statusCode":"","headers":{},"x":1120,"y":220,"wires":[]},{"id":"63c9fea6.a693c","type":"debug","z":"f9f46c0f.0b6ee","name":"msg flow 2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":850,"y":280,"wires":[]},{"id":"c228109f.8df0f","type":"split","z":"f9f46c0f.0b6ee","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":690,"y":220,"wires":[["28e7f22a.d012ae","63c9fea6.a693c"]]},{"id":"28e7f22a.d012ae","type":"file","z":"f9f46c0f.0b6ee","name":"","filename":"C:\\Temp\\Data\\ListData.txt","appendNewline":true,"createDir":true,"overwriteFile":"false","encoding":"utf8","x":890,"y":220,"wires":[["f239ecd2.53cbb"]]},{"id":"7e99fcd4.5d19e4","type":"fs-ops-dir","z":"f9f46c0f.0b6ee","name":"","path":"C:\\Temp\\Data\\Move","pathType":"str","filter":"*","filterType":"str","dir":"files","dirType":"msg","x":380,"y":140,"wires":[["88adace.207aa5"]]},{"id":"88adace.207aa5","type":"change","z":"f9f46c0f.0b6ee","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"files","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":540,"y":140,"wires":[["ac429f3d.5f6e6"]]},{"id":"ac429f3d.5f6e6","type":"delay","z":"f9f46c0f.0b6ee","name":"","pauseType":"delay","timeout":"300","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":710,"y":140,"wires":[["c228109f.8df0f"]]}]

I would like:
Flow1 after moving the first 5 zip files to the Move folder will delay about 5 seconds,
② then it will call Flow2 by http request node to output the ListData.txt file containing the names of these 5 zip files
③ and Flow1 continues to move the remaining zip files (Data_0006.zip, Data_0007.zip) to the Backup folder.
⇒ I can do this, but steps ①, ②, ③ need to be performed sequentially ①➡②➡③.
Is there a way while ② is in progress will perform ③?
(Assuming ②'s processing takes a long time, I don't want to finish ② and then do ③)

Is what I want to do is not possible?
Please tell me.
Thanks!

What exact problem are you having? You should be able to have two wires connected to the output of the delay node, one that goes to trigger Flow2 and one that triggers Flow3.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.