Many roads lead to Rome. It’s the same with Automic: different approaches may lead to the desired result.

I am a great advocate of knowing as many of the different approaches as possible in order to choose the right one for each situation. Often there are good arguments for different approaches and it depends on the situation what fits best.

A good example to illustrate this point is Promptsets (PRPTs). In this blog article I will show you how to use them. And, more importantly, I will explain why you should use them.

How to Create a Workflow with PRPTs?

Let’s demonstrate this with a very simple workflow: A script receives two numerical values via PRPTs and calculates the sum. After that, a job executes a number of pings according to the result ofthe script.

Nice and simple. The script receives 5 and 8, computes 13. The job executes 13 pings.

The crucial point of the workflow is: We have two tasks and the second task needs the result of the first as input.

There are (at least) two possibilities to accomplish this transfer. You probably know the most popular one and I will not go into it here: The value is passed on by inheritance using :PSET or :PUBLISH.

The second possibility is with a Promptset. For this, use a post condition to transfer the result of the first task to the workflow and then read the value into the second task with the prompt set. This even works if I completely disable inheritance for both tasks.

This second variant is more complex, as you have to create a Promptset – or several if you have a more complicated workflow.

But there are some good reasons to accept this additional effort.

Reason 1: Run Every Task by Itself

Both the script and the job can be executed individually and independently of the workflow. This allows you to easily perform unit tests, for example.

This leads to the fact that you can easily implement test automations. If instead all tasks inherit their variables globally, you need very complicated solutions.

Reason 2: Reuse Your Objects

Everything the objects need is transferred to them by PRPT. They do not use variables from other objects. Therefore, each object has its own name scope.

This allows any object to be reused as desired. In this workflow or in other workflows.

You may even package the objects and share them with other users.

Reason 3: Rerun Your Tasks

The workflow in the example is quite simple. But imagine you have a workflow with 15 tasks that run in sequence and whose values depend on each other.

And now imagine task 12 in the sequence fails because it had a wrong value.

Of course, you now want to run task 12 again, with the correct value. And then you also want to run tasks 13 through 15. Tasks 1 to 11 have already been executed successfully, so they should remain as they are.

If the workflow is built without PRPTs, there’s no elegant solution for that. You either have to edit tasks on Prod, or you have to abort the workflow and restart it with “wait for manual release”.

If the workflow was built with PRPTs, the solution is much easier.

Now, you can simply run the failed JOB again and then use the PromptSet to manually enter the desired value for the JOB.

Simple, clean and transparent – your auditor will thank you for it.

Should You Always Use PRPTs?

There’s no question: Working with PRPTs is more effort when creating them.

You may now be asking yourself whether you should always take on this extra work.

It’s not necessary. There is no solution which is always better or worse. You can choose depending on the task. But it is very useful to be familiar with this method and to know its advantages.

It’s just another arrow in your Automic quiver.

Here I have explained the basic idea and the resulting 3 main advantages.

You want to see exactly how it works? Then sign up for the 14-day trial version of my membership platform. There you will find the recording of a webinar in which I show step by step the implementation. It is the webinar recording from 2/14/2020 and you can find it in the member dashboard in the category “Archiv”.

If you already have an account, you can access the recording via this link.

Be aware though, that the Membership Service and all its contents are in German language only.

Get concentrated knowledge from 5 years of AutomicBlog

Download an archive with all old articles:

  • Features, SQL-Tricks, and handy Scripts.
  • 63 extensive articles (+ comments).
  • Used by Automic experts around the world.

Subscribe to the newsletter and immediately get all articles!

[caldera_form id="CF572741b60f87f"]