Deactivate workflow in case of error

The idea is:

Add a feature to automatically deactivate a workflow in case of an error in any of the nodes.

My use case:

Recently, I encountered an issue where a node at the end of a workflow failed due to an error on my part. This led to unnecessary consumption of the OpenAI API since the workflow was scheduled to run every 10 minutes and continued executing. Although I have an error workflow set up to notify me via email, I didn’t see the notification until later, which resulted in wasted resources.

I think it would be beneficial to add this because:

This feature would prevent unnecessary API calls and resource consumption by halting the workflow execution as soon as an error is detected. It would be especially useful for workflows running on frequent schedules, ensuring errors are managed immediately without manual intervention.

Any resources to support this?

Are you willing to work on this?

I would be happy to assist in testing or providing feedback for this feature.

Maybe a quick workaround: It should be possible to use the error trigger node to deactivate the workflow by calling the n8n API. You should be able to pass the workflow ID as a parameter.
In addition you could implement whitelisting using a filter node, so this applies only to certain workflows.

2 Likes

@octionic solid workaround, I was just thinking the same thing.

2 Likes

Thank you very much, I still have a lot to learn.

Done :wink:

2 Likes