In that case you need to queue a list of files to be processed and drop them off the list when they are done successfully. I have a flow for such requirements.
That is a example of how to do it (see below for flow for importing). It looks more complex than it is. It uses node-red-contrib-q-gate so you will have to install that first. Then feed messages in where the Inject node at the top is, and replace the second section with the flow to handle those messages, and as each one is processed then send a message either to the OK link or the FAIL link. When a message is processed ok then it will start the next one in the queue. If it fails then it will wait before trying again. The retry interval when messages fail is set in the Retry Inject node down the bottom.
To test the example flow clicking the Inject node at the top sends in messages and whether the processing fails or not is set by clicking the internet up/down inject nodes. If the internet simulation is down then repeatedly clicking the inject queues them up (you can see the queue count by the q-gate node) and when the internet up inject is pressed they will be released one at a time. Here the process is just a 4 second delay.
[{"id":"f82aed15.9f1a98","type":"q-gate","z":"bdd7be38.d3b55","name":"q-gate","controlTopic":"control","defaultState":"queueing","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","queueCmd":"queue","defaultCmd":"default","triggerCmd":"trigger","flushCmd":"flush","resetCmd":"reset","peekCmd":"peek","dropCmd":"drop","statusCmd":"status","maxQueueLength":"100","keepNewest":false,"qToggle":false,"persist":false,"x":450,"y":1880,"wires":[["ae4b0558.378d8","b6aba10c.b691f"]]},{"id":"6ec96b3b.ec5c14","type":"debug","z":"bdd7be38.d3b55","name":"OK","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":830,"y":1720,"wires":[]},{"id":"fed5956.ed73668","type":"inject","z":"bdd7be38.d3b55","name":"inject messages","props":[{"p":"payload","v":"","vt":"date"},{"p":"topic","v":"","vt":"string"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":1440,"wires":[["ec13c69e.384328"]]},{"id":"4ef6d24.5459eac","type":"inject","z":"bdd7be38.d3b55","name":"Retry","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"15","crontab":"","once":false,"onceDelay":0.1,"topic":"control","payload":"peek","payloadType":"str","x":130,"y":2000,"wires":[["50d6b6a6.3b4db"]]},{"id":"4270c3f6.19012c","type":"delay","z":"bdd7be38.d3b55","name":"process","pauseType":"delay","timeout":"4","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":340,"y":1580,"wires":[["b0c78702.b01988"]]},{"id":"a8381ab7.d1949","type":"link out","z":"bdd7be38.d3b55","name":"","links":["5a2f45b9.929cc4"],"x":795,"y":1680,"wires":[]},{"id":"5a2f45b9.929cc4","type":"link in","z":"bdd7be38.d3b55","name":"","links":["a8381ab7.d1949"],"x":135,"y":1880,"wires":[["1ec5d8f7.0e6ae7"]]},{"id":"1ec5d8f7.0e6ae7","type":"function","z":"bdd7be38.d3b55","name":"get next","func":"node.send({topic: \"control\", payload: \"drop\"})\nmsg.topic = \"control\"\nmsg.payload = \"peek\"\nreturn msg;","outputs":1,"noerr":0,"x":240,"y":1880,"wires":[["f82aed15.9f1a98"]]},{"id":"672111d5.4f229","type":"inject","z":"bdd7be38.d3b55","name":"Simulate internet up","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"internet","payload":"up","payloadType":"str","x":230,"y":1640,"wires":[["edb0af2.fd1645"]]},{"id":"bc5fa483.adc8f","type":"inject","z":"bdd7be38.d3b55","name":"Simulate internet down","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"internet","payload":"down","payloadType":"str","x":230,"y":1680,"wires":[["edb0af2.fd1645"]]},{"id":"edb0af2.fd1645","type":"join","z":"bdd7be38.d3b55","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":470,"y":1660,"wires":[["b7feed8e.7caf68"]]},{"id":"b0c78702.b01988","type":"change","z":"bdd7be38.d3b55","name":"topic:data","rules":[{"t":"set","p":"topic","pt":"msg","to":"data","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":1580,"wires":[["edb0af2.fd1645"]]},{"id":"b7feed8e.7caf68","type":"switch","z":"bdd7be38.d3b55","name":"Data message?","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"data","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":380,"y":1740,"wires":[["d96e80be.41aff"]]},{"id":"d96e80be.41aff","type":"switch","z":"bdd7be38.d3b55","name":"OK/Fail?","property":"payload.internet","propertyType":"msg","rules":[{"t":"eq","v":"up","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":560,"y":1740,"wires":[["6ec96b3b.ec5c14","a8381ab7.d1949"],["ea9c5a96.2dcfe8","37735513.24d77a"]]},{"id":"ea9c5a96.2dcfe8","type":"debug","z":"bdd7be38.d3b55","name":"FAIL","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":830,"y":1760,"wires":[]},{"id":"a20949f9.306a48","type":"gate","z":"bdd7be38.d3b55","name":"","controlTopic":"gate_control","defaultState":"open","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":650,"y":2000,"wires":[["f82aed15.9f1a98"]]},{"id":"ae4b0558.378d8","type":"change","z":"bdd7be38.d3b55","name":"Close gate","rules":[{"t":"set","p":"topic","pt":"msg","to":"gate_control","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"close","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":1960,"wires":[["a20949f9.306a48"]]},{"id":"a78ce065.5c9b68","type":"change","z":"bdd7be38.d3b55","name":"Open gate","rules":[{"t":"set","p":"topic","pt":"msg","to":"gate_control","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"open","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":2100,"wires":[["a20949f9.306a48"]]},{"id":"e5978b76.2fb2b","type":"link in","z":"bdd7be38.d3b55","name":"","links":["b6aba10c.b691f"],"x":135,"y":1580,"wires":[["4270c3f6.19012c"]]},{"id":"b6aba10c.b691f","type":"link out","z":"bdd7be38.d3b55","name":"","links":["e5978b76.2fb2b"],"x":655,"y":1880,"wires":[]},{"id":"37735513.24d77a","type":"link out","z":"bdd7be38.d3b55","name":"","links":["7f6b726d.0cab2c"],"x":795,"y":1800,"wires":[]},{"id":"7f6b726d.0cab2c","type":"link in","z":"bdd7be38.d3b55","name":"","links":["37735513.24d77a"],"x":95,"y":2100,"wires":[["a78ce065.5c9b68"]]},{"id":"5d647435.11ea14","type":"comment","z":"bdd7be38.d3b55","name":"Processed ok","info":"","x":690,"y":1660,"wires":[]},{"id":"cda552d1.59b25","type":"comment","z":"bdd7be38.d3b55","name":"Failed","info":"","x":670,"y":1800,"wires":[]},{"id":"6777d4.5738d02c","type":"comment","z":"bdd7be38.d3b55","name":"Replace this with your message processing, sending a message to the Fail or Success outputs","info":"","x":350,"y":1500,"wires":[]},{"id":"d1158219.184d38","type":"comment","z":"bdd7be38.d3b55","name":"Messages to be processed come in here","info":"","x":200,"y":1540,"wires":[]},{"id":"4681668e.9d5cd8","type":"comment","z":"bdd7be38.d3b55","name":"Feed messages to be queued in here and remove Inject node","info":"","x":270,"y":1400,"wires":[]},{"id":"177f73a0.c29e2c","type":"status","z":"bdd7be38.d3b55","name":"","scope":["f82aed15.9f1a98"],"x":120,"y":2040,"wires":[["b95b8054.e3339"]]},{"id":"b95b8054.e3339","type":"function","z":"bdd7be38.d3b55","name":"Queue empty?","func":"// expects msg.status.text in form \"queuing: <number>\"\n// sends a message if queue is empty\nif (parseInt(msg.status.text.split(\":\")[1]) !== 0) {\n msg = null\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":360,"y":2040,"wires":[["a78ce065.5c9b68"]]},{"id":"e72ba10d.c92638","type":"comment","z":"bdd7be38.d3b55","name":"Set this to appropriate retry interval","info":"","x":190,"y":1960,"wires":[]},{"id":"50d6b6a6.3b4db","type":"change","z":"bdd7be38.d3b55","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"peek","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"control","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":2000,"wires":[["a20949f9.306a48"]]},{"id":"ec13c69e.384328","type":"link out","z":"bdd7be38.d3b55","name":"","links":["781b2145.876168"],"x":425,"y":1440,"wires":[]},{"id":"781b2145.876168","type":"link in","z":"bdd7be38.d3b55","name":"","links":["ec13c69e.384328"],"x":295,"y":1920,"wires":[["f82aed15.9f1a98","50d6b6a6.3b4db"]]},{"id":"7f6da01b.0e5768","type":"comment","z":"bdd7be38.d3b55","name":"Leave this alone except for setting retry interval","info":"","x":220,"y":1840,"wires":[]}]