Vadim Tabakman

What do you do if your workflow fails mid process? Well, you will have to click on the status link of that workflow and then click the Terminate Workflow link.

When it comes to Nintex Workflows, this isn't always the case. Granted, some errors can not be caught, but there are some actions that Nintex provides, that have built in Error Handling capabilities.

These include :
Call Web Service
Create Appointment (Exchange 2007)
Create Task (Exchange 2007)
Execute SQL
Query BDC
Query Excel Services
Query LDAP
Query XML
Update XML
Web Request
Create List
Convert Value
Add User To AD Group
Create AD Account
Create AD Group
Decommission AD Account
Delete AD Group
Enable LCS/OCS
Provision User on Exchange
Remove User from AD Group
Update AD Account
Copy to SharePoint
Create a Site
Create Site Collection
Decommission Site Collection
Delete a Site

That's 27 actions that we can work with, where if an error occurs, we can capture it and intelligently design our workflow so that the workflow doesn't just fail.

As an example, I'm going to have a fairly simple workflow that has a Call Web Service action. If the web service call fails, then the workflow would throw and example and you would see the error in the workflow history. Again, you'd need to terminate the workflow, resolve the issue and start it the workflow again from the beginning.

Now we enable error handling.

First we'll need a workflow variable of type Text. This is where the error will be stored when (if) it is caught.



Now, in our Call Web Service action, we scroll down to the very bottom, and click on the "Error Handling" section to expand it.

For the first field "Capture Errors", we set it "Yes". This turns error handling on.
For the third field "Store error text in", we set it to our text variable. If an error occurs, then the text variable will contain the error message that is caught.



It's all good that we have the error, but what should we do with it? The first thing to do is use a Set a Condition action. Here we need to check if our text variable contains any data. If it doesn't, the action completely successfully. If it contains data, then we need to perform some business logic to handle the error.



In the workflow for this atricle, I decided to use an Assign a Todo Task action, and ask the initiator of the workflow, whether we should continue with the with workflow or not. The details of which is another article I will hopefully put together in the future. But this is just a small example of how we can perform error handling and continue workflow processing.

Another example would be :
A Call Web Service action goes an asks a web service for a date for when a project should conclude. For some reason, the web service is down, or failing for another reason. We can capture this, and instead defer to an alternative way of getting this date (such as asking a project manager).

Below is a screenshot of the workflow I have been playing with. It's not something that I would necessarily put into production, but it's a place to start.



Useful Downloads :

Download Workflow

Posted by Vadim Tabakman Sunday, February 5, 2012 9:40:00 AM Categories: Error Handling Nintex Nintex Workflow
Copyright Vadim Tabakman
Rate this Content 0 Votes

Comments

Friday, May 4, 2012 12:47:41 AM
Umer Farooq

re: Nintex Workflow - Error Handling

Hi download link is not accessible.

Thanks

Friday, May 4, 2012 12:54:20 AM
Umer Farooq

re: Nintex Workflow - Error Handling

Plz check th link

 

http://www.vadimtabakman.com/Data/Sites/1/vtdownloads/blog/errrohandlin/TestErrorHandlingWorkflow.nwf

 

Friday, May 4, 2012 7:22:28 AM

re: Nintex Workflow - Error Handling

Hey Umer Farooq,

thanks for letting me know about that.  I fixed the link.  You should now be able to right click and save the workflow.

cheers,

Vadim

Saturday, February 15, 2014 3:36:42 AM

re: Nintex Workflow - Error Handling

Dear Vadim Tabakman

Can you give any idea how to maintain the state of nintex workflow and run from there again where error occurred.Because when error occurred either it continue if you handle error otherwise whole workflow instance fail.

How I main state of workflow and again run from there where error occurred.

 

Thanks In Advance

Saturday, February 15, 2014 11:52:14 PM

re: Nintex Workflow - Error Handling

Hi Saya,

try something like this : http://www.vadimtabakman.com/nintex-workflow-smart-restart-workflow-middle-of-a-workflow.aspx

cheers,

Vadim

Thursday, May 29, 2014 9:05:41 AM
Nintex Error handling
Gravatar

re: Nintex Workflow - Error Handling

Hi,

I have created nintex custom activity. In execute which calling Desinger activity. Here I want to implement error handling for custom activity. How it can be achieved. from SDK I able to show error handling section in aspx page of nintex custom action. but it is not expecting

Can you please help regarding this.

Thursday, May 29, 2014 9:22:31 AM

re: Nintex Workflow - Error Handling

Hi,

I'm not sure what you mean by it's not expecting.  The SDK should show you how to add the error handling section.

Once that is done, you need to configure it in your action in the workflow designer, to turn it on and capture the error in to a text variable.

cheers,

Vadim

Thursday, May 29, 2014 9:58:24 PM
shardul Pasare
Gravatar

re: Nintex Workflow - Error Handling

Thank you Vadim for your quick reply.

Just to clear, I have created nintex custom activity. And as per SDK we have added error handing section. But it is not capturing error thogh workflow has error.

One more point to add, There was custom activity already developed for designer . In Nintex we are reusing same activity . i.e. In execute method we are calling object of existing activity. So my question is,  we require to declare all properties (captureErrors, ErrorOccurredOutput, ErrorMessageOutput) in existing activity also?

 

Friday, May 30, 2014 7:44:29 AM

re: Nintex Workflow - Error Handling

Hi shardul,

have you debugged your action?  Put breakpoints into the Execute function.  Is there error happening there?

Do you have a Try/Catch around the code there?

It's possible the error is happening in SP, outside your actions.

cheers,

Vadim

Tuesday, September 2, 2014 3:26:14 AM
Mario
Gravatar

re: Nintex Workflow - Error Handling

Hi Vadim

Thanks a lot for this great post.

I just have a little problem remaining: How can I get the URL of a just created list?
Unfortunately the "create list" action does not have an option "Store URL in" like e.g. the "Create Site" action has. So do you have any idea, how I can store this URL into a variable?

Any help will be very much appreciated... :-)

Best regards,
Mario

Tuesday, September 2, 2014 8:00:55 AM

re: Nintex Workflow - Error Handling

Hi Mario,

as you have found, the action doesn't return the list url.  You'll need to build it up yourself with a Build String action.

Since you know the Site Url (you either picked the site from the site picker in the action or entered a Url), you should have that part.

Then simply add a List/<listname> to it and you'll have your url.  Or if it's a Document Library, leave off the List/ part.

cheers,

Vadim

Monday, April 27, 2015 2:17:17 AM

re: Nintex Workflow - Error Handling

Hi, I am using Pause Until...Pause For, and so on ....such as delay opeartions in my Nintex Workflow 2013. but the workflows are giving error out. Workflow error as " Failed to run" Can you please help me out to solve my issue. 

 

Monday, April 27, 2015 8:22:13 AM

re: Nintex Workflow - Error Handling

hi siva

 

Check your SharePoint logs when the error occurred.

cheers,

vadim

Wednesday, January 20, 2016 12:31:12 AM
Leif Frederiksen
Gravatar

re: Nintex Workflow - Error Handling

Hi Vadim,

 

What about the field "Store error occurences in" - what is that for? I cannot select anything in the drop down - what type of variable does it expect?

 

Regards

Leif

Wednesday, January 20, 2016 1:04:21 AM

re: Nintex Workflow - Error Handling

its a yes/no variable.

tells you if an error occurred or not.

vadim

You must sign in to this site to post comments.
Already Registered?
Sign In
Not Yet Registered?
Register

Statistics

  • Entries (279)
  • Comments (1769)

Categories