Initial setup

This sections contains the following topics:

Initial setup

Under this chapter, you will find a set of instructions to guide you through the first steps in the CWM application. This initial setup allows you to prepare your workplace and start executing workflows.

Use these guidelines to accomplish the following:

Procedure


Step 1

Install adapters and create workers: First, you would need to add and install adapters that allow workflows to interact with external systems. In this guide, it's assumed that you will use the default adapters shipped with CWM, or that you have custom adapter(s) developed and ready to use. For execution of your adapter activities and code, you need workers. You can create a worker directly during adapter installation.

Step 2

...configure secrets and resources: Adapters mostly communicate with external entities via APIs, and they need to have connection data, like port or host, and authentication data, like username with password. This information is kept in secrets and resources. The structure and schema for each resource and secret type are defined in the adapter files. As an operator, you can add secrets and resources to the CWM. Once created, they can be reused by different workflow definitions and passed on when needed.

Step 3

...and finally, add your workflow definition:Workflow definitions, in CWM shortly referred to as workflows, are a piece of code intended to automate operations, written in JSON or YAML and follow the Serverless Workflow Specification. Before workflows can be executed, they need to be added to the CWM application.

When you complete this setup you are ready to run your first job.


Install adapter

This section explains how to upload an adapter file in the CWM and then install (deploy) it.

Procedure


Step 1

In CWM, go to the Admin -> Adapters tab.

Step 2

Click the Add Adapter button.

Figure 1. Add adapter
Add adapter

Step 3

In the Install a new adapter modal, click on the file uploader to select an installable adapter file from your local machine and click Upload. You can find adapter files in the CWM software package.

Figure 2. Upload adapter file

Note

 
The only supported file format is tar.gz.

Step 4

After the adapter file is uploaded to the CWM database, optionally tick Automatically create worker for this adapter checkbox if you want to create one, then click Install Adapter to finish the installation process.

Figure 3. Install adapter
Install adapter

Note

 
If the installation is interrupted or you chose Cancel in the modal, the adapter will be added to the CWM database and visible in the adapters list, but not installed and unusable by workflows. If you canceled the installation intentionally and want to remove the adapter from the list, click Delete under the Actions column.

Step 5

If your adapter was installed, you should see the successful message on the modal "Your_adapter's_name has been fully installed!". Click Done.

Figure 4. Adapter installed
Adapter installed

Note

 
"Adapter not installed" If the process was interrupted or failed, you can finalize it later by clicking the Install button under the Actions column.
Figure 5. CWM_install_button_01.jpg

Set adapter as default for associated activities

You can set which adapter should be the default one for associated activities. To do so, follow the steps below.

Procedure

Step 1

In CWM, go to the Admin -> Adapters tab.

Step 2

In the adapters list, click the name of the chosen adapter to open the adapter's details view.

Step 3

Tick the checkbox Use as default version for associated activities.

Figure 6. Set default adapter
Set deafult adapter

Step 4

Click Save Changes.

Note

 

After setting the adapter as the default one, you should see a relevant status under Set as default column on the adapters list.


Delete adapter

You can delete the adapter from CWM only if it has the status Not in use under the In Use column in the adapters list.

Note


Adapters already used by running workflow(s) with the status In use cannot be deleted.
Procedure

Step 1

In CWM, go to the Admin -> Adapters tab.

Step 2

Find the adapter you want to remove from the adapters list and click the Delete button in the same row under the Actions column.

Step 3

In the Delete Adapter modal, confirm by clicking the Delete Adapter button.

Figure 7. Delete adapter
Delete adapter

In case the delete option is disabled, you need first to terminate the running workflow(s) using this adapter and remove associated workers.


Add worker

This section explains how to create a worker in CWM.

Prerequisites: You should have added and deployed adapter(s).

Procedure


Step 1

In CWM, click the Admin tile from the navigation menu on the left. In the Workers view, click Add Worker.

Step 2

In the Create new worker modal, provide the required input:

  1. Worker name: type a name for your worker, for example, MyNewWorker. Once created, it cannot be modified.

  2. Start worker after creation: tick the checkbox to automatically start the worker.

  3. Activities: tick the checkboxes for selected adapter activities you want to assign to your worker. In our example, a worker for the Generic Rest adapter's activities is created.

    Figure 8. Create new worker

Step 3

Click Create worker.


Create secrets and resources

This section explains how to add secrets and resources to CWM.

Prerequisites: Uploaded adapter(s) with workers.


Note


It's recommended to add secrets to CWM before creating resources, as resources utilize secrets.

Add secret

Procedure

Step 1

In CWM, go to the Admin -> Secrets tab. In the Secrets view, click Add Secret.

Step 2

In the opened New secret view, provide the required input:

  1. Secret ID: type a unique name for your secret.

  2. Select a Secret type from the drop-down menu. Secret types are defined inside adapters and are added to CWM upon adapter installation.

Step 3

After selecting the secret type, a set of additional fields is displayed under the Secret type details section. Fill in the fields (for example, username and password) with values. These fields can vary among the secret types and are specified in the adapter files.

Note

 

You can change the secret type and its details later.

Step 4

Click the Create Secret button.

Once you've added a secret and its details, create a resource in CWM and associate it with the secret.


Add resource

Prerequisites: You should have added secret(s).

Procedure

Step 1

In CWM, go to the Admin -> Resources tab. In the Resources view, click Add Resource.

Step 2

In the opened New resource view, provide the required input:

  1. Resource name: type a unique name for your resource. Once created, it cannot be modified.

  2. Select a Resource type from the drop-down menu. Resource types are defined inside adapters and are added to CWM upon adapter installation.

Step 3

After selecting the resource type, a set of additional fields is displayed under the Connection section. Fill in the fields (for example, host or port) with configuration details. These fields can vary among the resource types and are specified in the adapter files.

Step 4

Select a Secret ID from the drop-down menu to associate a previously created secret with this resource.

Note

 

Although the Secret ID and Connection details are not mandatory fields to fill while creating a resource, and you may insert proper values later, they are necessary to make a resource work properly.

Step 5

Click the Create resource button. Once created, your resource is displayed on the list in the main Resources view.


Add workflow

This section explains how to add a workflow definition to CWM.

Procedure


Step 1

In CWM, go to the Workflows -> All Workflows tab.

Step 2

Click the Create new workflow button.

Figure 9. Create New Workflow button
Create New Workflow button

Step 3

In the Create new workflow modal, provide the required input:

  1. Workflow definition name – type the name for your workflow definition, for example, MyFirstWorkflow.

  2. Version – type your workflow definition version, for example, 1.0.

Step 4

Click Create Workflow. The steps above create a workflow entry in CWM with dummy code that needs further editing. In the next section, you can check how to insert your workflow definition and replace the pre-defined code.

Figure 10. Create workflow

Workflow editing

Procedure

Step 1

To edit an existing workflow, from the All Workflows tab, click on the chosen workflow definition name to open the Detail tab. You can add there a description, edit a version or workflow definition name, or assign tags to the workflow definition.

Note

 

To add more workflow tags, separate them with a comma.

Note

 

Workflow tags are separate from job tags, and are passed to every single execution of this workflow definition (job run). You can edit workflow tags from the workflow definition details level, but once they are added to the already executing run, they cannot be changed.

Figure 11. Workflow details
Workflow details

Step 2

Go to the Code tab to edit a workflow definition. By default, after creating a new workflow in CWM, the Code tab contains a dummy piece of code that you need to replace with the actual developed workflow definition in JSON or YAML, based on Serverless Workflow Specification.

Step 3

After inserting the desired changes, there are several actions you can take by using the buttons on the right:

  1. Done: rejects any changes and takes you to the previous page.

  2. Save as new workflow: creates a new workflow definition with inserted changes and keeps the previously saved version of the workflow definition (do not overwrite the changes on the same workflow definition, but create a separate, new workflow definition).

  3. Delete: removes the workflow definition from CWM.

  4. Save Changes: saves the inserted changes for the current workflow definition.

  5. Run: executes the workflow definition as a single job.

Figure 12. Workflow details buttons
Workflow details buttons

Note

 

You can update the workflow definition and up-version it without affecting the currently running job.


Bulk tags editing

You can edit tags for many workflow definitions at once. You can add a tag(s) to all selected workflows or remove all tags by resetting them.

Procedure

Step 1

In CWM, go to the Workflows -> All Workflows tab.

Step 2

Select chosen workflows by ticking the checkbox on the right side of the All Workflows table, then click on the Edit tags button.

Figure 13. Bulk edit tags
Bulk edit tags

Step 3

In the Edit tags modal, under the Select action section, click on the chosen radio button depending on whether you plan to add tag(s) or reset them:

  1. Add tags to all: assign one or more tags (separated by a comma) to all selected workflows.

  2. Reset tags for all: remove all tags for selected workflows.

    Figure 14. Edit tags
    Edit tags

Step 4

Click Save.

Step 5

The result will be visible under the Workflow tags column.

Figure 15. Bulk edit tags
Bulk edit tags