I have built a custom code in a workflow. My goal is, if the custom code fails (a.k.a. hs_execution_state != Succeeded), I want the workflow to send a Slack notification, and then finish. If not, I want the workflow to continue its course.
easiest option I can see off the top of my head would be to include a step either in the same or in a separate code step to send a JSON payload in order to post a slack message if the original code has failed. Slack has an API so you could post a message to a channel there readily enough. You can find some support for this online: https://stackoverflow.com/questions/50187220/is-there-any-way-to-post-a-webhook-using-javascript
Hi @crossm98👋 Thanks for your question. To check my understanding, is your goal to have a form of an If/then statement after your custom code executes? Based on the outcome? If the code fails, then send the Slack notification. Is that correct?
I looked at the documentation here, Custom code workflow actions, but didn't find a great match for what you are describing.
That's precisely what I'm looking for. Make the custom code run. If it fails, send a slack notification and finish. If it runs correctly, continue the workflow.