Workflow Builder

Workflow Builder is graphical interface inside Uniconfig UI to create, modify and manage workflows.

Creating new workflow

To create new workflow click on New button in Workflows -> Definition tab and fill in workflow general parameters. Then you can proceed with adding tasks.

Note

Parameter name is required and must be unique. Keep in mind that name cannot be changed later. Other parameters are optional and can be changed anytime.

alt_text

Editing existing workflow

To edit already existing workflow, find the workflow in Definitions tab, click on it and then click on Edit button. Diagram of the workflow will be rendered on canvas. Now you can restructure workflow, add new tasks, remove tasks or edit workflow information and parameters.

Adding tasks

To add new task on canvas, find the task in the left menu, drag and drop the task on canvas.

To remove one task, select task by clicking on it once and press Delete on keyboard. To remove multiple tasks, hold Shift and left click on respective tasks, then press Delete on keyboard.

alt_text

Task parameters

To edit or add task parameters, double-click on task placed on canvas.

Input parameters can be declared as:

  • Input provided by user, e.g.:

${workflow.input.<name>}

  • Variable provided by other task, e.g.:

${<taskRefName>.output.result}

  • Statically defined, e.g.:

https://example.com/api/user

For full documentation of tasks read https://netflix.github.io/conductor/configuration/taskdef/.

System tasks

Fork & Join

Fork is used to schedule parallel set of tasks.

Note

A Join task MUST follow Fork task.

alt_text

Decision

A decision task is similar to if…else statement in a programming language. The task takes 2 parameters:

  • name of the parameter in task input whose value will be used evaluated (default is param)

  • value that will be compared with param (or other specified input variable)

If param and is equal to are evaluated as equal, the workflow will continue to If branch, otherwise the workflow will continue in else branch.

Note

Else branch is optional and can be empty.

alt_text

Lambda

Lambda Task helps execute ad hoc logic at Workflow run-time, using javax & Nashorn Javascript evaluator engine.

This is particularly helpful in running simple evaluations in Conductor server, over creating Workers.

alt_text

The task output can then be referenced in downstream tasks like: ${lambda_test.output.result.testvalue}

HTTP

An HTTP system task is used to make calls to another microservice over HTTP.

You can use GET, PUT, POST, DELETE Methods and also you can set your custom header.

alt_text

TERMINATE

Task that can terminate a workflow with a given status and modify the workflow’s output with a given parameter. It can act as a “return” statement for conditions where you simply want to terminate your workflow.

For example, if you have a decision where the first condition is met, you want to execute some tasks, otherwise you want to finish your workflow.

name

description

notes

terminationStatus

can only accept “COMPLETED” or “FAILED”

task cannot be optional

workflowOutput

Expected workflow output

alt_text

EVENT

Event task provides ability to publish an event (message) to either Conductor or an external eventing system like SQS. Event tasks are useful for creating event based dependencies for workflows and tasks.

alt_text

When producing an event with Conductor as sink, the event name follows the structure: conductor:<workflow_name>:<task_reference_name>

WAIT

A wait task is implemented as a gate that remains in IN_PROGRESS state unless marked as COMPLETED or FAILED by an external trigger. To use a wait task, set the task type as WAIT

alt_text

Subworkflows

Subworkflows acts as a regular task in parent workflow. Subworkflow can be unbundled into its respective tasks (or other nested subworkflows) by selecting (clicking) on it and then by clicking on Expand.

Note

Simple tasks differs in color shade from Subworkflow tasks and cannot be expanded.

alt_text

You can expand unbundled tasks/subworkflows further or you can simply delete, edit, restructure or add new tasks.

Note

Unbundling and editing subworkflow (as a part of other workflow) will not change the original definition of subworkflow.

Linking tasks

To connect tasks or subworkflows into execution flow, drag and drop respective Out and In endpoints on nodes, in a way: Out —> In

alt_text

To remove link, hold Shift and left click on link, then press Delete on keyboard.

alt_text

Adding worklow information

To provide additional workflow information, click on Edit general in upper right corner.

Output parameters

We can specify custom output parameters of workflow, by using JSON template to generate the output of the workflow. If not specified, the output is defined as the output of the last executed task.

Let’s say we have task with taskReferenceName: task1 which returns summary and we want output of the workflow to be output of this specific task only. The outputParameter value named e.g. finalResult will be: ${task1.output.summary}

For full documentation of workflow parameters and definition read https://netflix.github.io/conductor/configuration/workflowdef/.

Defaults & Description

Here, we can define default values and descriptions for workflow inputs. Each input value declared as ${workflow.input...} will appear in dropdown list of available input parameters.

Save and execute workflow

To Save workflow, click on Save button in upper left corner. Then you can find the workflow in Workflows -> Definitions tab.

To Execute workflow directly from builder, click on Execute button. You will be prompted to provide input parameters.

Note

Executing workflow will also save workflow.

Import and export of workflow

To import workflow on canvas, click on Import in upper left corner and select valid JSON definition of the workflow.

Note

Imported workflow will not be saved untill you click on Save or Execute

To export and save workflow in JSON format into your file system, click on Export.

Note

In order to choose a location to which you want to export worklow, you have to have it enabled in browser settings. Default location is Downloads folder.

Creating custom workflow subsets

In order to create new custom subset containing workflows, assign a label with prefix CUSTOM_ to the workflow and it will appear as a new group in left side menu.

alt_text