Orchestrator lets you to configure conditions with Smart Links. Smart Links connect individual activities in a runbook and support precedence between two activities.

Also as soon as previous activity finishes, these links invoke next activity. Best part is you can set link conditions to determine the direction of workflow.

For example you can monitor a folder and trigger next activity for each changed and deleted files within that folder. At this situation, you can split in two your workflow to configure separated activities for changed and deleted triggers. For example;

Now here is the magic starts. Click to Smart link to set a custom condition.

I want to set a condition as Status.txt from Append Line activity has a line of “Changed”. This provides that link will invoke next activity (Send Event Log Message) if specified condition is true.

Same condition for other smart link. This provides that link will invoke next activity (Send Email) if specified condition is true.

So if I change any file within C:Test folder, smart link condition will redirect flow through the upper link and send an event log.

Let’s test with RunBook Tester.

Monitor file checks for changed and deleted files in C:Test

I changed a file within C:Test folder and saved it.

Orchestrator triggers the change and hops to the next activity.

Append Line activity appends “Changed” string to the status.txt file.

Now only matched link condition will continue on its way.

As you see below, Send Event Log Message is invoked by the upper smart link.

Here is the log file created by Orchestrator.

Because filtering in smart links is based on published datas from previous activities, you can also use smart link conditions with PowerShell based runbooks.

Here is an another example. It simply reads a text file to get required links. Then it checks for links with Select-String cmdlet and directs flow to the related side. Rest of workflow is about copying files to the remote servers and deleting source downloaded files.

Read Line activity just reads two lines.

Links.txt file includes two different URL to download filea or fileb from Internet.

To find out which link (FileA or FileB) is provided within txt file, I wrote a little custom PowerShell script.

It scans text file and search for DownloadfileA or DownloadFileB strings. If there is a line that includes one of those strings, (not null), StatusA or StatusB variables get filea or fileb values.

To pass these variable values to the next activity and links, simply configure them as Published Data.

Now I can tell to my smart links that to filter only for StatusA and StatusB static values.

Finally, if there is a URL in Links.txt file that has a string “downloadfilea”, smart link will redirect flow through upper activities. For links that includes downloadfilea string will flow through below activities.

Before finishing blog post, final important activity is Junction. It allows you to wait for multiple branches in a runbook to complete before continuing past the junction.

Junction activity can also publish data again from any branch so that downstream activities past the Junction activity can consume the data. Data from different branches than the one you selected will not be available