Workflows
SchedulerX supports cross-application job orchestration. You can orchestrate jobs from the same application or from different applications into a single workflow based on their execution logic.
Create a workflow
-
Log on to the SchedulerX console.
-
In the top navigation bar, select a region.
-
In the left navigation bar, click Workflow Management.
-
On the Workflow Management page, select the target namespace, and then click Create Workflow.
-
In the Create Workflow pane, set the Name, Description, Application ID, and Time Type, and then click OK.
NoteCurrently, you can schedule a workflow only by using a cron expression.
You can also set the Advanced Configuration, Time Zone, and Task Concurrency in the Calendar section.
Create a job
-
On the Workflow Management page, select the workflow and click Edit to open the Workflow Details page.
-
Click Create Task and configure the parameters in the Create Task panel. After the job is created, it is added to the workflow and also appears on the Job Management page.
The upper-right corner of the Workflow Details page contains the Import Jobs, Create Job, and Edit Workflow buttons. The central area displays each job node and its dependencies.
Import jobs
-
On the Workflow Management page, select an existing workflow and click Edit to go to the Workflow Details page.
-
On the Workflow Details page, click Import Jobs. From the Select Application drop-down list, select an application, and then click Import in the Actions column for each job you want to add. By default, the application to which the current workflow belongs is selected.
Orchestrate jobs
Add a dependency
You can add a dependency by dragging a line between nodes.
Example 1: Job 619 is the upstream job for Job 620. After Job 619 finishes, Job 620 starts.
Example 2: After Job 101 finishes, Jobs 102 and 103 start simultaneously. Job 107 starts only after Jobs 104, 105, and 106 all succeed.
Delete a dependency
You can delete a dependency in one of two ways:
-
Select a line that connects two nodes in the workflow diagram and press the DELETE key.
-
Right-click a line that connects two nodes and then click Remove.
Edit or remove a job
Select a job node in the workflow diagram, right-click the node, and then select Edit or Remove.
Publish a workflow
After you create and configure a workflow, click Publish on the details page. This enables the workflow to run on its defined schedule. To test the workflow without enabling it, click Run Once on the Workflow Management page. Once you confirm it works as expected, you can publish it.
Manage workflows
View an instance diagram
-
On the Workflow Management page, find the workflow, and in the Actions column, choose More > History. The panel lists workflow instances with columns such as Data Time, Start Time, End Time, Operator, and Instance ID/Instance Diagram.
-
In the Instance History panel, click an ID in the Instance ID/Instance Diagram column to view the status of all nodes in that workflow instance. A diagram displays node statuses by color: Waiting (gray), In Pool (yellow), Running (blue), Successful (green), Failed (red), and Skipped (dark gray).
Stop an instance
-
On the Workflow Management page, find the workflow, and in the Actions column, choose More > History.
-
In the Instance History panel, click Stop. This action forcibly stops all running nodes, and the instance status changes to Failed.
After you stop the instance, nodes that have already completed (for example, jobA) remain in the Successful (green) state. Nodes that were forcibly stopped (for example, jobB and jobC) change to the Failed (red) state. Downstream nodes that have not yet run (for example, jobD and jobE) remain in the Waiting (gray) state.
Rerun an instance or node
Rerun a workflow instance
You can rerun a failed workflow instance.
-
On the Workflow Management page, find the workflow, and in the Actions column, choose More > History.
-
In the Instance History panel, choose More > Rerun. This action reruns all failed nodes in the instance, and its status changes to Running.
After the rerun starts, previously failed nodes (for example, jobB and jobC) change to the Running (blue) state. Upstream nodes that were already successful (for example, jobA) remain in the Successful (green) state. Downstream nodes (for example, jobD and jobE) remain in the Waiting (gray) state.
Rerun a node
-
On the Workflow Management page, find the workflow, and in the Actions column, choose More > History.
-
In the Instance History panel, click Details to open the workflow instance details view.
-
Right-click the target node and select one of the following options:
-
Rerun node and downstream: Reruns the current node and all its downstream nodes.
-
Rerun node only: Reruns only the current node. Downstream nodes are not affected.
-
-
Click OK in the confirmation dialog box to rerun the selected node or nodes.
Pause an instance
You can pause a running workflow instance.
-
On the Workflow Management page, find the workflow, and in the Actions column, choose More > History.
-
In the Instance History panel, click Pause. The system waits for any running nodes to complete, then halts the execution of subsequent nodes. The instance status changes to Paused.
After you pause the instance, nodes that have completed their execution (for example, jobA, jobB, and jobC) remain in the Successful (green) state. Subsequent nodes that are pending execution (for example, jobD and jobE) remain in the Waiting (gray) state, and the workflow does not proceed.
Resume an instance
You can resume a paused workflow instance.
-
On the Workflow Management page, find the workflow, and in the Actions column, choose More > History.
-
In the Instance History panel, click Resume to continue the execution of downstream nodes.
After you resume the instance, previously paused downstream nodes (for example, jobD) change to the Running (blue) state. Completed nodes remain Successful (green), and nodes further downstream (for example, jobE) remain in the Waiting state.
Skip a node
You can skip a node in a workflow that has not yet started. The workflow then automatically proceeds to the next node in the sequence.
-
On the Workflow Management page, find the workflow, and in the Actions column, choose More > History to view its execution history.
-
In the Instance History panel, click an ID in the Instance ID/Instance Diagram column. On the Workflow Instance Details page, select the node and click Skip. Alternatively, you can right-click the target node to open a context menu with the options Details, Logs, and Skip.
The final result shows the skipped node (for example, jobD) in the Skipped (dark gray) state, while other nodes execute normally and finish in the Successful (green) state.
Cancel skip
You can cancel the skip operation for a node and restore it to the execution queue, provided its downstream nodes have not yet started.
-
On the Workflow Management page, find the workflow, and in the Actions column, choose More > History to view its execution history.
-
In the Instance History panel, click an ID in the Instance ID/Instance Diagram column. On the Workflow Instance Details page, select the skipped node and click Cancel Skip.
Import and export workflows
To synchronize workflows across different regions or namespaces, you must manually export and then import them.
Export a workflow
-
On the Workflow Management page, select an application from the All applications drop-down list. Select the checkboxes for the workflows you want to export, and then click Export Workflow. If no workflows are selected, all workflows for that application are exported.
-
In the dialog box that appears, select an Application ID, confirm the workflow information, and then click OK.
Import a workflow
On the Workflow Management page, click Import Workflow. In the dialog box, select an Application ID and choose a policy for Duplicate jobs (either Overwrite or Skip). Then, upload the workflow file in the Import Workflow area, and then click OK.
Before you import a workflow, you must first import its required jobs. The Application ID of the target application must match the Application ID from which the workflow was exported. To learn how to import jobs, see Import or export jobs.