I looked in to the documentation but the information is very limited or I just don't understand it End results I am looking for is when the workflow fails I get a slack message.
I created a global error handler with the example from the documentation, I get the error
"error": "sendMessage is not defined"
and how do I push this message through slack when it's working?
Would like to add my thanks to Stefan as this has helped me out also.
Whilst the error was useful, I had quite a large function and the error message was still a little ambiguous as to where the actual problem lied.
So for those that experience the same, within the script that's erroring, you can also just attach whatever you need to the workflowContext, e.g.
workflowContext.currentRun.errorObj = JSON.stringify(x);
Then in your Slack error handler just add this to the bottom.