Jobs

This section covers the following topics:

Jobs

After completing the instructions described in Initial setup, you are ready to start executing workflows.

In CNC Workflow Automation, a particular execution of a workflow definition is called a job. By following the guidelines in this chapter, you can:

Run a Job

This topic explains how to run a job (workflow execution).

Before you begin

Ensure you have created a workflow definition and have uploaded one or more adapters with workers.

Procedure

  Command or Action Purpose

Step 1

In CWM, choose Design > Workflows > Find the workflow you want to execute and click Run under the Actions column.

Step 2

In the Run job window, insert the initial workflow data input in the Input field.

Step 3

By default, your job’s name is the same as your workflow definition, but you can change it in the Job name field.

Step 4

Optionally, you can assign tags to your job. To insert more than one tag, separate them with a comma.

Note

 

Tags are case-sensitive. Once added to the job, you cannot edit them.

Step 5

Leave Run directly selected to run your job immediately. If you want to create a schedule for a future run, follow the steps in Schedule a job.

Step 6

Click Run job to start the workflow execution.

Check job status

Procedure

  Command or Action Purpose

Step 1

In CWM, choose Operate > Jobs.

Step 2

In the Jobs table, find your job and check the status of the workflow execution in the Status column.

  • If the workflow was executed correctly, a green icon and the status Completed is displayed.

  • If the workflow execution is still in progress or the workflow engine is retrying an action, a blue icon with three dots and the status Running is displayed.

  • If the workflow execution failed, a red icon and the status Failed is displayed.

Check job result

You can check results for any failed or completed job.

Procedure

  Command or Action Purpose

Step 1

In CWM, choose Operate > Jobs

Step 2

In the Jobs table, find the job you want and click the job name to view its details.

Step 3

To see basic information about the job, review the Job summary tab at the top of the table.

Step 4

To check the input and result of the execution, click the Input and results tab in the middle of the table.

Click Copy to copy the contents of the Input or Results panel to the clipboard.

Step 5

In Event history tab, you can expand each Workflow event entry by clicking on the arrow icon on the left-hand side.

Click Copy to copy the contents of any Workflow event panel to the clipboard. Or click Download to download the entire event history as a JSON file.

Find child workflow runs in Event History

If a given job run triggers child workflow executions, you can check them under the Event history log of the parent run. Child workflow names are created using the following schema:

parent_job_run_name.child_workflow_def_name.child_workflow def_version.

For example, if a parent job-run name happens to be Parent, the child workflow definition name is Child, and the child workflow definition version is 1.0, the job run executed as a child workflow will be named Parent.Child.1.0. .

Procedure

  Command or Action Purpose

Step 1

In CWM, choose Operate > Jobs

Step 2

In the Jobs table, find the parent job you want and click the job name to view its details.

Step 3

In Event history, under the Workflow events column, search for a ChildWorkflowExecutionStarted or ChildWorkflowExecutionCompleted entry. Click on its event name; you will be redirected to the job details page of this child workflow execution.

Step 4

On the child job's Details page, in addition to the standard fields, you will find the Parent Run ID that redirects you to the details of the parent job run.

Note

 

Child workflow runs do not inherit tags applied to their parent job runs.

Rerun job

Procedure

  Command or Action Purpose

Step 1

In CWM, choose Operate > Jobs.

Step 2

In the Jobs table, find the job that you want to rerun.

Step 3

Click the Rerun button in the Actions column in the same row as the job you want to rerun.

Step 4

In the Rerun job window, you can edit the Job name, tags and Input (data input) or use the same values as the previous run.

Step 5

Click Run job.

You can also rerun the job from the job's Details tab.

Cancel job

Procedure

  Command or Action Purpose

Step 1

In CWM, choose Operate > Jobs.

Step 2

Select the Active filter at the top of the table, find a job that you want to cancel and click the Cancel button in the same row under the Actions column.

Step 3

In the Cancel job window, you can enter an optional Reason for cancelling.

Step 4

Check the Force terminate checkbox if you want to cancel the running job immediately. If you leave this checkbox unticked, the workflow worker will complete the ongoing task execution from the workflow definition and then cancel the job.

Step 5

Click Cancel Job.

You can also cancel the job from the job's Details tab.

Schedule a job

This topic explains how to schedule a single job run (workflow execution) or recurring runs that are invoked in the future.

Before you begin

Ensure that you have added a workflow definition and listed it in the Workflows view, and uploaded one or more adapters with workers.

Procedure

  Command or Action Purpose

Step 1

In CWM, choose Design > Workflows.

Step 2

Select the workflow you want to schedule and click Run under the Actions column.

Step 3

In the Run job window, insert the initial workflow data input in the Input field. Each scheduled run of a workflow receives identical input variables.

Step 4

By default, your job name is the same as your workflow definition name, but you can change it in the Job name field.

Step 5

Optionally, you can assign tags to your scheduled job(s). To insert more than one tag, separate them with a comma. All jobs in the schedule will have the same tags set.

Step 6

Choose one scheduling option depending on whether you planned a single run in the future or a recurring series of runs:

  • A) Schedule for specific date and time: Pick a specific time and date for a single run.

  • B) Cron: set recurring runs based on cron expressions

Step 7

Type a unique name for your schedule in the Schedule ID field.

Step 8

Click Schedule Job to schedule the workflow execution(s).

Note

 

Overlap policy: By default, the schedule overlap policy prevents overlapping runs in one schedule. If the previous job from a given schedule is still being executed while it's time to start the next scheduled job, the next run will be skipped. If you want to allow overlapping runs, you can change the overlap policy via the API.

Check scheduled jobs

All schedule jobs are displayed in the Operate > Jobs window, under the Scheduled jobs tab. When a scheduled job is executed, it will be shown in the Active jobs tab. When the job is completed, it will display in the Completed jobs tab.

A schedule job does not have an expiration date. This means that you can update the scheduled job anytime and retrieve some of its details. A scheduled job is displayed on the Scheduled job table even if it only one job is scheduled for a specific date and time, and that job has already been executed. If you don’t want the scheduled job to be displayed in the list of scheduled jobs, you must delete it.

Procedure

  Command or Action Purpose

Step 1

In CWM, choose Operate > Jobs.

Step 2

Click the Scheduled jobs tab at the top of the window.

Step 3

In the Scheduled jobs table, you can find all the schedule jobs, with details:

  • A) Schedule ID: unique identifier for every schedule

  • B) Job Name: name of the scheduled workflow execution; shared between all runs in a schedule

  • C) Workflow Definition: name of the workflow definition used to run a scheduled job(s)

  • D) Next scheduled run: the date and time of the next upcoming run in the schedule, for example 05-May-2023 03:59:25 PM CEST

  • E) Type: indicates whether the scheduled run is planned once in the future (Specific date and time), whether there are recurring runs (Cron) or recurring runs based on frequency (Frequency).

  • F) Job tags: keyword(s) assigned to the scheduled job run

  • G) Workflow tags: keyword(s) assigned to the workflow definition used for that planned run plus its version

  • H) Actions: displays possible actions for the schedule.

Delete scheduled jobs

Deleting a scheduled job will delete all future planned jobs in that schedule, but will not affect a job that is already in execution. You can cancel a scheduled job that is already being executed using the Cancel job action.

Procedure

  Command or Action Purpose

Step 1

In CWM, choose Operate > Jobs.

Step 2

Click the Scheduled jobs tab at the top of the window.

Step 3

In the Scheduled Jobs table, find a scheduled job that you want to delete and click the Delete button under the Actions column in the same row as the job you want to delete.