All Products
Search
Document Center

SchedulerX:Manage workflows

Last Updated:Jan 19, 2024

SchedulerX supports cross-application job orchestration. You can use a workflow to orchestrate jobs of an application or jobs of different applications based on the same execution logic.

Create a workflow

  1. Log on to Distributed Task scheduling platform.

  2. In the top navigation bar, select a region.

  3. In the left-side navigation pane, click Workflows.

  4. On the Workflows page, select a namespace from the Microservices Namespace drop-down list and click Create Workflow.

  5. In the Create Workflow panel, configure Name, Description, Application ID, and Time type based on your business requirements, and click Confirm.

    Note

    Job scheduling in SchedulerX workflows supports only cron expression-based time settings.

    image.png

    In the Advanced Configuration section, configure Time zone, Calendar, and Task concurrency based on your business requirements.

Create a job

  1. On the Workflows page, find the created workflow and click Edit to go to the Workflow Details page.

  2. Click Create task to create a job. In the Create task panel, configure parameters based on your business requirements. After the creation is complete, the job is added to the workflow. You can also view the job on the Jobs page.

    image.png

Import a job

  1. On the Workflows page, find the created workflow and click Edit to go to the Workflow Details page.

  2. On the Workflow Details page, click Import tasks. In the Application drop-down list, select an existing application. In the job list that appears, find the job that you want to import and click Import in the Operation column. By default, the application to which the current workflow belongs is selected.

Orchestrate jobs

Add dependencies

You can drag lines into workflows to add dependencies. In the following figure, job 619 is the upstream of job 620. After job 619 is executed, the system starts to execute job 620.

image.png

Sample workflow:

image.png

In the preceding figure, after job 101 is executed, the system starts to execute job 102 and job 103 at the same time. After job 104, job 105, and job 106 are executed, the system starts to execute job 107.

Delete dependencies

You can use one of the following methods to delete dependencies:

  • Click a line in the workflow chart and press the DELETE key.

  • Right-click a line in the workflow chart and click Remove.

Edit or delete a job

Right-click a node in the workflow chart and click Edit or Remove.

Publish a workflow

After you create or modify a workflow, you can click Publish to enable the workflow and start the scheduling. If you do not want to immediately enable a workflow, click Run once in the Operation column of the workflow on the Workflows page to test the workflow before you manually enable it.

Manage workflows

View a workflow

  1. On the Workflows page, find the workflow that you want to manage and choose more > Historical records in the Operation column to view the historical execution records of the workflow.image.png

  2. On the Process instance records page, click the ID of the instance that you want to manage in the Instance ID/Process instance diagram column. On the Workflow Instance Details page, view the status of each node in the workflow.

Stop a workflow

  1. On the Workflows page, find the workflow that you want to manage and choose more > Historical records in the Operation column.

  2. On the Process instance records page, find the instance that you want to manage and click Stop in the Operation column. In this case, all nodes in the workflow are forcibly stopped, and the workflow enters the Failed state.image.png

Rerun a workflow

You can rerun a workflow that is in the Failed state.

  1. On the Workflows page, find the workflow that you want to manage and choose more > Historical records in the Operation column.

  2. On the Process instance records page, find the instance that you want to rerun and click Heavy run. In this case, all the failed nodes in the workflow are rerun, and the workflow enters the Running state.

    image.png

    Example:

Pause a workflow

You can pause a workflow that is in the Running state.

  1. On the Workflows page, find the workflow that you want to manage and choose more > Historical records in the Operation column.

  2. On the Process instance records page, find the instance that you want to pause and click suspend. The suspend setting takes effect only after all running jobs are executed. Subsequent jobs will not be executed, and the workflow enters the Suspended state. image.png

Remove a workflow from the Suspended state

You can remove a workflow from the Suspended state.

  1. On the Workflows page, find the workflow that you want to manage and choose more > Historical records in the Operation column.

  2. On the Process instance records page, find the instance that you want to remove from the Suspended state and click Cancel Pause to resume the running of downstream jobs. image.png

Skip a job

If a job in a workflow is not run and you do not want to run the job any longer, you can skip the job. In this case, the job that comes next in the workflow is run.

  1. On the Workflows page, find the workflow that you want to manage and choose more > Historical records in the Operation column.

  2. On the Process instance records page, click the ID of the instance that you want to manage in the Instance ID/Process instance diagram column. On the Workflow Instance Details page, right-click a job node and select skip.image.png

Cancel the skip operation

You can cancel the skip operation on a job node and run the job if the job node you skipped is a downstream node whose execution time point has not arrived.

  1. On the Workflows page, find the workflow that you want to manage and choose more > Historical records in the Operation column.

  2. On the Process instance records page, click the ID of the instance that you want to manage in the Instance ID/Process instance diagram column. On the Workflow Instance Details page, right-click a job node that is skipped and select Cancel Skip. image.png

Import or export a workflow

If you want to synchronize workflows across regions or namespaces, you must manually import or export the workflows.

Export a workflow

  1. On the Workflows page, select an application from the All applications drop-down list and select the workflow that you want to export. Then, click export workflow. If you do not select the workflow that you want to export, all the workflows of the selected application are exported.

  2. In the dialog box that appears, select an application ID, confirm the workflow information, and then click OK. image.png

Import a workflow

On the Workflows page, click Import workflow, upload the desired workflow, and then click OK.image.png

Important

Before you import a workflow, you must import jobs. The application ID of the imported workflow must be the same as the application ID of the exported workflow. For more information, see Import or export a job.