Creating your First Workflow

This topic is interesting for first users of Automic Automation. It describes how to create a basic Workflow. The Workflow contains a Job and a Notification object. When the Workflow is executed, the Job is processed and, if it ends successfully, the Notification is triggered. For more information, see Creating Your First Job, Enhancing Your First Job and Creating Your First Notification.

The example described here addresses not only developers and object designers. It is also relevant for operators and managers. As an operator or manager, to be able to monitor processes, analyze them and identify potential problems, you must understand how objects work and how they interact.

Tip: Have a look at the following topics to get acquainted with the look and feeling of the Workflow editor.

What You will Learn

What You Should Know Beforehand

Before we start, you should know what these basic concepts mean:

Overview

  1. Create a Standard Workflow
  2. Add the Job and the Notification Objects
  3. Connect the Objects
  4. Check the Dependency
  5. Execute the Workflow
  6. Open the Workflow Execution Report

Create a Standard Workflow

Add a STANDARD Workflow to the GETTING_STARTED_OBJECTS folder that you created here: Creating Your First Job.

  1. Click the Add Object toolbar button.

  2. Select Workflow > STANDARD and click OK.

  3. On the Object Name dialog enter the name of the Workflow. Call it JOBP.FREE.DISK.SPACE.QUERY.

  4. Click OK.

  5. The Workflow opens to the Workflow editor page. It displays the object definition tabs on the left and the canvas where you design the Workflow on the right. This is what it looks like:

Add the Job and the Notification Objects

You have several options to add objects to a Workflow:

We will use the Global Search option.

  1. To insert the Job, start typing its name in the Search field. The Global Search opens a drop down list with a selection of the results of the search. This is what it looks like:

  2. Click the Job in the drop down list and drag and drop it onto the canvas.

  3. To insert the Notification, start typing its name in the Search field. When it is displayed in the list, drag and drop it onto the canvas.

The two objects are inserted in the Workflow now. This is what it looks like:

Connect the Objects

After adding tasks to your Workflow, you connect them to establish their execution sequence. Connecting tasks means establishing a dependency among them. You connect tasks by drawing a line between them. The task where the line starts is the predecessor. The target task is the successor.

To connect tasks, you use the floating toolbar in the canvas. This toolbar contains tools that help you when designing a Workflow. Let's have a closer look at its upper part:

After you have connected the tasks, you have a functioning Workflow. Notice that if you hover your mouse over the task boxes, or over the START and END nodes, a tooltip shows relevant configuration data about the task. For more information, see Task Boxes in Workflows.

Check the Dependency

Before executing the Workflow, let's have a look at the dependencies between the Job and the Notification.

An object that is inserted in a Workflow has additional configuration options that apply only when it is executed from within the Workflow. These options can influence when and how the tasks in the Workflow are executed.

When you draw a connection line between tasks, you establish a basic dependency between those tasks. Let's have a look at it:

  1. Select the Notification.

  2. Click the Properties button in the toolbar. The properties pane is displayed on the bottom half of the canvas. It contains tabs with the task configuration options.

  3. Open the Time & Dependencies tab.

    In the Dependencies section, the table shows the Job in the Task Name column. The value entered in the Status column determines the status that the predecessor task must have for the Notification to be executed. By default, the Status is empty. You can change the status here, or you can define a Client-wide default status for all tasks in Workflows. You do this in your user settings. For more information, see Default Task Status for Workflow Dependencies .

Configure the Tasks in the Workflow

Tasks that are inserted in a Workflow keep the properties that have been defined in the corresponding objects. Sometimes it is necessary to define additional properties for the tasks in a Workflow. To define such properties you have two options:

A pane with several tabs opens on the bottom half of the Workflow canvas. Each tab contains options that you can configure for the selected task. The properties that you define this way apply to the selected task only when it is executed from within the current Workflow.

So far, we have configured the following:

  1. A Job that queries the space on the disk and writes the value to a variable.
  2. A Notification object that creates a request and that uses the same variable.
  3. A Workflow that, when executed, will process the Job first and then the Notification object.

We want the request created by the Notification to write the result of the resolved variable both to the request and to the report. For this purpose, we have to configure the properties of the Job in the Workflow. We have already defined the variable in the Job, and the Workflow takes over this configuration. You can check it by right-clicking the Job, selecting Properties and opening the Variables tab.

Define the Post Condition that Publishes the Value of the Variable

Tasks in Workflows can have preconditions and postconditions. Preconditions are processed before the task runs, postconditions after it has run. In our example, the value of the variable is resolved after the Job has run. For this reason, we have to define a postcondition in the Job.

  1. Go to the Postconditions tab.
  2. Click Add Postconditions.
  3. On the Postconditions of JOBS.WIN.RETRIEVE.FREE.DISKSPACE dialog open the Actions tab.
  4. Grab the PUBLISH VALUE option from the Action pane and drop it on the right.
  5. Click either VALUE or VARIABLE NAME to activate the input box.
  6. Enter the following values:

    • Value: &FREESPACE#
    • Variable name: FREESPACE_IN_BYTE#

    This is what it looks like:

  7. Click OK.
  8. Save the Workflow.

Execute the Workflow

Let's execute the Workflow and have a look at its report. Click the Execute button in the toolbar. The following happens:

Open the Workflow Execution Report

Executable objects go through four stages during execution. The first stage is Activation. The activation report logs all steps that the object goes through during this phase.

Click the Last Report button in the toolbar. The report view opens to the Activation (ACT) report.

The report provides the following information:

  1. The Job is activated and it gets its runID.
  2. The Notification is activated and it gets its runID.
  3. The object variable defined in the Job is read and the corresponding value is applied.

The objects and the processing steps in this example are basic, so the report is short and simple. However, complex objects and processes produce long reports. For this reason, as well as for auditing purposes, you have the option to download the report.

To Download the Report

  1. Open the Activation (ACT) drop down list.
  2. Select Directory.
  3. Click the download icon next to the file name.

Next

As soon as a task is executed, it is available in the Process Monitoring perspective. The next step in this Getting Started guide is to monitor the execution of the Workflow. For more information, see Monitor.