This topic was automatically generated from Slack. You can find the original thread here.
Is there a way to terminate a workflow successfully, but mark it’s state as failed?
In some cases, we’re handling the error reporting ourselves with custom Slack notifications, so we don’t need the additional failed workflow notification from Pipedream.
But in the workflow inspector, it would be nice to see the state of those workflows as failed/terminated with errors (otherwise, they are hard to find).
It’s an interesting use case and I hear you completely re: wanting to flag it as an error.
The best way right now would be to create a custom error workflow. In each of your original workflows, you’d throw an error:
throw new Error("error")
Errors that you want to appear with the error status (but not notify you) could be of the form InternalError* (for example). Since you have access to the error name + stack in the custom error workflow, you could exit early on these special errors so you don’t send yourself a Slack notification.
yeah in this case, you could disable that setting and just reproduce the Slack message in your custom error workflow. I can share the current Slack block code that’s used in that error notification if that would be helpful!
So if you visit your workflow’s Settings and uncheck the Notify me on errors toggle. You’ll still see them reported as errors in the UI, you’ll get them in Slack since you’re error-handling in code, and they won’t trigger the global Slack notifier
We’re only handling errors we’re expecting (from third party APIs), so it would still be good to be notified of the other unexpected ones (in case a step fails for some reason), as you mentioned.
We’ll stick to the original idea. It’ll allow us to devise error handling in a generic way, which will reduce repetition in some of our workflows.
Although that may mean we need to disable error handling for those workflows, so that we don’t get notified twice (once from the workflow itself and once from the error handling workflow).
But if generic error handling works well… we’ll just disable the default Slack notifications entirely.
Ok cool that makes sense. Yeah the global error notifier is pretty cool… we tried to modernize the dead letter queue! If you have any feedback on that implementation / any suggested improvements definitely let us know