After looking at some examples and browsing the forum I could not find much information on how to handle errors in side an execute method.
For example, I go to retrieve something and it is not there. At this point the activity can not complete. What is the best practice at this point, throw an exception or just set the cancel status
Thanks

Custom Activity - Errors Best Practice
Dan S
This helps little. However what is the recommendation when you do not know how the activity is going to be used i.e. creating an activity for use by others. If there is going to be third party activity market how should errors be handled by the activity writers. You almost need another status coming from the activity like error So the activity never lets an exception out but the workflow knows that an error has occurred.
Uwe Keim
The only time you would want to let a known exception escape Execute is if you want the workflow author to specifically catch the exception.
Hope this helps Rabi.
Arjun
Floele
_ross
If the exception thrown by Execute() is not something that you expect workflow authors to explicitly catch via an exception handler, then you should cancelling or closing the activity would be more appropriate. What's the specific scenario for the custom activity you're creating
sunzhoujian
If you cancel, subsequent activities in the flow will be allowed to execute. If you throw, the workflow will terminate unless the exception is caught.