Move input file to an error folder
A common pattern is to use the Move Operation of the file operations mode with a catch node. If an error occurs during processing, the catch node can route the message to a file operations node that moves the file to an error folder for inspection or retry.
See Trigger flow with a folder capture node for instructions on setting up a watched folder. That is the first step for this flow.
In this example, the all in one node processes the file, and after successful processing the file is deleted with a file operations node. If the file does not process, it is picked up by the catch node, and moved with another file operations node.
In the Properties for the file operations node, you can enter the Target file as a JSONata expression. The node then reads the file path from msg.filename to determine which file to act on, and the Target file path is dynamically constructed. For example, the JSONata expression:
C:/workspace/folder-capture/error/" & msg.file.basename
combines the path to the error folder with the file’s base name extracted from msg.file.basename.
This approach helps maintain clean input folders and supports robust error handling in production environments.
Many nodes in OL Connect Automate accept JSONata expressions. For sample expressions, see JSONata expression samples