cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Error Handling Questions

rharkness
Deputy Chef I
Deputy Chef I
  1. What does the job status say "Successful" when there was an error thrown and captured by the "Monitor" action
  2. I'm processing large recordsets and as I loop through them I feel it's not ideal for the end user to get an email for every error.  Has anyone successfully implemented a digest form of error email that sends one email at the end of the recipie with every captured issue?
1 ACCEPTED SOLUTION

gary1
Executive Chef III
Executive Chef III
  1. The monitor catches the error. Once it's caught, you can do what you want -- implement some fallback logic to handle the error, or throw an error to shut down the recipe. Use the "stop" action and set it to "Failed"
  2. Yes, this is possible and you can do it many different ways.  As errors occur, collect the data you want to email in a variable list (e.g., an array). Once all of the records are processed, if the error list is not empty, you can email the contents raw or as JSON or as an attachment or whatever you want. If you want to prettify it, you can use a Message template action to transform the array into an HTML table or something nice.

View solution in original post

4 REPLIES 4

gary1
Executive Chef III
Executive Chef III
  1. The monitor catches the error. Once it's caught, you can do what you want -- implement some fallback logic to handle the error, or throw an error to shut down the recipe. Use the "stop" action and set it to "Failed"
  2. Yes, this is possible and you can do it many different ways.  As errors occur, collect the data you want to email in a variable list (e.g., an array). Once all of the records are processed, if the error list is not empty, you can email the contents raw or as JSON or as an attachment or whatever you want. If you want to prettify it, you can use a Message template action to transform the array into an HTML table or something nice.

mppowe
Executive Chef II
Executive Chef II

Just to add to what @gary  said, our strategy right now is to make a common error-handling recipe that will create a ServiceNow incident with whatever details we give and up to 2 attachments (eg CSV) with the relevant data.  That way it doesn't have to be a dev (or someone with workato access) to troubleshoot/resolve.

gary1
Executive Chef III
Executive Chef III

This is smart, and sounds like a great way to clear up a few hours of my day ๐Ÿ˜‚

I don't know why I didn't think of that.  Back in my java coding days I always had an error handling class.  One of my clients uses ServiceNow, so that may be a good idea to look into at a later date to slide in a process to log tickets for failed jobs!

Now to go off and write my error handling recipe.  I want it to send an email with an attachment.  In my case, I need to do digest emails of the errors since my recipes all seem to involve mega-loops of data