Finding Out “How Did I Get Here?” in a Runbook
Published Feb 15 2019 11:45 AM 229 Views
First published on TECHNET on Apr 26, 2012

I recently saw a new feature suggestion in the Orchestrator feedback on Connect and I realized that we can actually accomplish the requested functionality today in Orchestrator, so I thought I’d share how.

Here is the feedback from the customer:

There are times when it would be very helpful to know which activity called another activity within a runbook. I would like the published data to include two new items "Calling Activity Name" and "Calling Activity ID". This can be used to determine what activities called each other in complex runbooks with multithreaded operations where it can be difficult to troubleshoot why a particular path in the runbook was followed.

I decided to build a sample runbook to test this functionality out. In the example below, I have a runbook that can follow one of three paths, but all three paths lead to the same activity (“Rejoin”) at the end. My goal is to find out which path was taken in order to reach the “Rejoin” activity.

In my initialize Data activity, I define a parameter named “Path”. In my links going out from the Initialize Data activity, I specified conditions (shown in the link text) so that a single link would be followed if I entered 1, 2 or 3 for the “Path” parameter. The “Path 1”, “Path 2” and “Path 3” activities don’t do anything. The important thing we want is the activity name itself so we can determine which activity was run prior to the Rejoin activity.

In the Rejoin activity, I’m creating a variable named $pathTaken and using published data to get the activity name from each of the activities that link into the Rejoin activity.

Then, on the Published Data tab, I define the “Previous Activity” property that will get published to the databus, and the contents of that coming from the $pathTaken variable I created in PowerShell.

When I use the Runbook Tester to run the runbook, I get prompted for the “Path” parameter, for which I enter 1, 2, or 3 on subsequent tests.

The output from the Rejoin activity now shows “Path 1”, “Path 2”, or ”Path 3”, which are the names of the activities that ran prior to the Rejoin activity depending on the path chosen.

You can also add the activity ID or any other published data available from the activity so provide more detailed information. So hopefully this addresses the request and once again we demonstrator that “you can do that” with Orchestrator.

Version history
Last update:
‎Mar 11 2019 09:13 AM
Updated by: