I have built a fairly complex GitHub workflow, and this is the last piece (possibly). I am using the GitHub Get File Node to get the contents of a file in a repo and store it. The file list is fetched by getting files changed in commits and then using the file path to get the file contents.
Some commits will remove files, and this is where the problem is.
When the file is removed, the Get File node fails with a 404 error. This leads to the workflow failing.
I would like to know if there is a way to handle this error and continue the workflow execution if the file is not found.
I just want to be able to handle error similar to how you can do in an HTTP node where you send the error to a different node and if you want to continue the workflow, you can do so.
Note: I do get the files status like “remove” “added” etc, but since I am dealing with mutliple commits and merging them together a file removed in 1 commit can be added back by another commit and vice versa, so status aren’t useful unless I add more steps like sorting commits by date and then merging files smartly possibly using a code node.
n8n version:
1.40.0
Database (default: SQLite): SQLite
n8n EXECUTIONS_PROCESS setting (default: own, main): not sure
What I do is under the Settings for the node there is an option to always output data, What this will do is just carry on if there are any issues so you can then use an if node to check if {{ $json.error }} exists so on your true output it will have the errors and on the false the items you are after.