Changing the status of the Runbook, Activity and Instance to failed RRS feed

  • Question

  • Hi there,

    I am having an issue with the runbooks I designed. I mostly have Run Program activities in my runbooks. When the prorgram in the activity fails I am unable to set the Activity status as failed and also the Runbook. As a result when I look at the Orchestrator console all runbooks report as successful. Which to me does not make any sense and I dont understand why it was designed to report the activity status that way.

    So, what I am looking to do is if a program has failed I want the activity and runbook to fail and the same reflected in the console.

    Please help.



    Vithal Maddala

    Thursday, February 27, 2014 4:41 AM

All replies

  • Vithal, it's the way Orchestrator handles Activities.  Technically if your 'Run Program' Activity runs, then Orchestrator views that as successful, even if it failed in what it was trying to do.  A couple ways around that:

    - use Smartlinks to guide your next step.  For example, set the smartlink to go one path if the return code is equal to 0 and go another if it is not equal to 0.

    - use the 'compare value' Activity.  This allows you to compare the value of some output of your Run Program activity and then make some decisions on how to proceed based on whether it is true or false. 

    Thursday, February 27, 2014 6:35 AM
  • Hi there,

    Thanks for your reply. Much appreciated.

    I am indeed using the SmartLinks to go to the next steps. However, no matter what I do, I am unable to see any failures in the Orchestrator console which is very misleading. If the program failed to run I would like to reset the status of the activity to failed. Scorch activities always succeed unless I do something like invalid SMTP address in an email notification activity or incorrect SQL query. But even then the whole runbook still comes out as successful.

    I did find other articles in the forum discussing similar issues but none of them had any good detail in them.

    Any help would be appreciated.


    Vithal Maddala

    Thursday, February 27, 2014 10:54 PM
  • ah, I see what you are saying now.  Yep, that's a little quirk that I have noticed too.  

    Does this help:

    This doesn't 'reset' the previous activity that failed but with smartlinks you could show an error in the console immediately after the failure.

    otherwise i'm out of ideas!

    Friday, February 28, 2014 1:24 AM
  • Hi there,

    Thanks for your reply.

    I am actually using his workaround in using a runbook that is designed to fail. But one of his statements is incorrect

    Failed = Last activity that executes has status failed.

    A runbook will only have a failed status if every activity in it has failed else it will only exit with a warning message.

    I am looking at the SDK to come create my own custom activity to force the status of the activity to fail of the program its running fails. I am not sure how successful i'll be.



    Vithal Maddala

    Friday, February 28, 2014 4:11 AM
  • An easy workaround to do it is as follows:

    • Connect a .NET Script Activity via smartlink "Exitcode does not equal 0"
    • Insert a simple script - where you throw the "Pure Output"-Published data from the Run Program Activity
    • Use a here-string to avoid breaking the error message string if Quotation marks are used
    • The throw is acknowledged by the orchestrator engine as an error and marks the runbook as failed

    Script example:

    $RunProgramErrorMsg = @'

    {Pure Output from Run Program Activity}


    throw $RunProgramErrorMsg

    Gracjan Zawadzki, IT-Consultant

    • Edited by phat_gz Thursday, March 6, 2014 12:57 PM
    Thursday, March 6, 2014 12:53 PM
  • what is {Pure Output from Run Program Activity} in above code?



    Friday, September 13, 2019 11:19 PM
  • Hi @msloy,

    The Pure Output is basically an unmodified output that the program will give, if you want more detailed output, use Program Output.

    Best regards,

    Blog: LinkedIn:

    Saturday, September 14, 2019 12:56 PM