2. Workflows

Workflows are built with Atomic Actions and they act as lego pieces to create workflows.

2.1. Workflows

2.1.1. Creating a New Workflow

  1. Select the “New Workflow” button.
../_images/newworkflow.png
  1. Click on the empty palette to see all the properties of the workflow on the right side panel.
  2. Provide a display name and a description.
  3. Drag an action from the left side panel from any category desired. For an example, we will be using the “AWS Service” named “Create VPC”.
../_images/createvpc.png
  1. Click on the action to see the properties required in the right side panel.
  2. Click the empty palette and add the AWS Endpoint to the target section under execute on a target.
../_images/selecttarget.png
  1. Go back to the “Create VPC” action you will see that you can now select the target as use workflow target or you can override it.
../_images/choosetarget.png
  1. Provide a name tag and an IP address.
../_images/createvpcinfo.png
  1. Add a new action called “Create Subnet in a VPC”.
../_images/createsubnet.png
  1. Provide it a name, an IP CIDR Block, and an availability zone.
../_images/createsubnetinfo.png
  1. Click the puzzle piece next to VPC ID and go to Activities, Create VPC, and then VPC ID to add the ID.
../_images/addidvariable.png
  1. The example workflow is now complete.

2.1.2. Running a Workflow from the UI

  1. Click the “Validate” button.
  2. Click the “Run” button.
../_images/runworkflow.png

2.1.3. Running a Workflow from the API

The following API call can be used to start a workflow

/v1/workflows/start

More information can be found here.

2.2. Runs

Runs allow you to see what actually occurred within your workflow. It lets you see every single step that happened so you can easily see where something went wrong.

2.2.1. How to See Runs

  1. In the left side panel below “Workflows” you will see a tab for “Runs”.
../_images/runs.png
  1. Find runs for a specific workflow by going to the workflow and hitting the “View Runs” button.
../_images/specificrun.png
  1. The runs page will show you the status of the run, the time it was started, the time it ended, the user it was started by, and the owner of the workflow.
../_images/status.png
  1. Use the filter on the left to see specific results and workflows.
../_images/filter.png

2.2.2. How to View a Failed Run

  1. Click on a workflow that failed it will take you to the workflow and put a green box around everything that ran successfully and a red box around what failed.
  2. Click on the red box and see what all the input and output was to find the error.
../_images/failedrun.png

2.3. Targets

Targets specify where you want your actions or workflows to run. There are both single targets or target groups to choose from.

2.3.1. Creating Single Targets

  1. Create a new single target click the “New Target” button.
../_images/newtarget.png
  1. Choose a target type.

Note

HTTP Endpoint is the most common target type.

../_images/targettype.png
  1. Create a display name and description.
  2. Choose to apply an account key or create a new one.

Note

Account keys are only required for actions that require authentication.

  1. Provide the HTTP protocol, host/ip address, the port, and the path.
../_images/targetinfo.png
  1. Click the “Submit” button.

2.3.2. Adding Targets to a Workflow

  1. Open the workflow.
  2. Select the target you created.
../_images/addtarget.png

2.3.3. Creating Target Groups

TODO add info here

2.3.4. Account Keys

Account keys are used to authenticate to a target that is used in workflows. Account keys can be credentials like usernames and passwords or they can be certificates.

2.3.4.1. Creating a New Account Key

  1. Click on the “New Account Key” button.
../_images/accountkeybutton.png
  1. Choose the target account key type.
../_images/keytype.png

Note

The most common key type is HTTP Basic Authentication or HTTP Client Certificate Authentication. Most REST interfaces will use HTTP Basic Authentication.

2.3.4.2. Example of Creating New Account Keys

  1. To create a HTTP Basic Authentication Key you will provide a display name and a description. Then you will add the credentials and click the “Submit” button.
../_images/httpkey.png
  1. To create an Email Credentials Key you will provide a display name and a description. Then you will provide a from email address and a password then click the “Submit” button.
../_images/emailkey.png
  1. To create a SNMP Credentials Key you will provide a display name and a description. Then you will provide a version number, a username, and a security level then click the “Submit” button.
../_images/snmpkey.png

2.3.4.3. Using an Account Key

  1. Under “Targets” you can choose a target and apply an account key you created to it.
../_images/newkeytarget.png

2.4. Atomic Actions

Atomic actions are the building blocks of workflows.

2.4.1. Creating an Example Atomic Action

This atomic action will call out a postman echo and echo the response back to us.

2.4.1.1. Postman Echo

  1. Start by clicking the “New Workflow” button.
../_images/newworkflow.png
  1. Scroll down in the left side bar until you reach “Web Service” and add a “HTTP Request” to the workflow.
../_images/newecho.png
  1. Provide the HTTP Request the display name “Postman Echo” and provide a description.
  2. Provide the relative URL “/get”.
../_images/getURL.png
  1. Go to the target section and select execute on a target.
  2. Create a new target called “Postman Echo” and provide it the URL “postman-echo.com”.
../_images/echotarget.png
  1. To test the request please change “/get” to “/get?test&test2” then validate the workflow and run it. In the response JSON you will be able to see “test”, “test2”, and some unnecessary data.

2.4.2. Removing Unnecessary JSON

  1. To remove the extra unnecessary JSON add another action called “JSONPathQuery”. This allows you to pick which data you want to be returned back.
../_images/jsonpath.png
  1. In the right hand bar scroll down to JSON Query and click the puzzle piece to add a source JSON to query.
  2. Click activities then “Postman Echo” then choose the body.
../_images/jsonvariable.png
  1. Add a JSON Path Query by providing “$.args” and the property name “args”.
  2. To test this action validate the workflow and run it. If you look at the response from the “JSONPathQuery” you will just see “test” and “test2”.

2.4.3. Making the Workflow Reusable

  1. Click an empty spot on the screen and then add a variable.
  2. Choose the data type string, add a display name of “Args”, choose the scope to be input, and make it required.
../_images/args.png
  1. Go back to the “Postman Echo” action and change the “/get?test&test2” by leaving the “/get?” and clicking the puzzle piece to select the variable you made.
../_images/selectargs.png
  1. Set an output variable by adding a “Set Variables” action to the workflow.
../_images/setvariableecho.png
  1. Go back to the main options for the workflow and add a new variable of type string called “OutArgs” and change the scope to output.
../_images/outargs.png
  1. Add the variable to the “Set Variables” action by clicking the puzzle piece and choosing “OutArgs” for the variable to update section and for the variable value new section select JSONPath Query then Jsonpath Queries then args.
  2. Validate the workflow and select the “Is Atomic Workflow” button and give it a group name.
../_images/atomicworkflow.png
  1. Validate the workflow again and you can no longer click run.
  2. To use the “Postman Echo” workflow you can create a new workflow and now add the “Postman Echo” action.