Working with the Orchestration Databus
I was working with some Orchestration Pack workflow activities and came across a scenario where the activity worked as intended, but I couldn’t figure out how to further use output data from the activity. Enter the Orchestration Databus, which “enables workflow designers to track the flow of data through an Orchestration workflow and provides access to output data that can be consumed by other custom activities”. I wanted to expand further on the article.
For this example, I’m working with the Resolve DNS Name activity. The activity is pretty simple, just supply a FQDN to determine if the name resolves in DNS.
The activity will then return “resolved” or “unresolved”. Again, I couldn’t figure out how to get access to the result output from the activity since there is no place to run a Sensor Script.
Using the Databus, I could get output data from the Resolve DNS Name activity and drop it into a Run Script activity. Here’s how:
- Within the Run Script activity, click on the “Toggle Script Tree” icon. Expand “Activities” and then the activity you want to use.
- Click on the output variable you want to use, for example “Result”. This will give you a code snippet for like get(16).result. The value within the parenthesis is the unique index value of the activity. You can find the activity indexes under the Data tab within your workflow.
- Sample code and result using the Databus:
https://www.servicenow.com/community/developer-articles/working-with-the-orchestration-databus/ta-p/2321908