Publish and unpublish scheduling tasks in DataWorks

Updated at:

This topic describes how to publish, unpublish, and recover tasks in a standard mode workspace. It also explains what happens to existing instances when you unpublish a task.

Publish a task

To publish a task, you deploy its node to the production environment for scheduling. Follow these steps.

Submit the node to the development environment > Publish the task to the production environment > Verify the recurring task in Operation Center.

Submit the node to the development environment

Publish the task to the production environment

Verifying production tasks against the production scheduling task list

Method 1: Submit a single task

Method 2: Submit a business flow

Unpublish a job

To unpublish a task, you remove it from the production scheduling system so that it is no longer scheduled. Follow these steps.

Delete the task in DataStudio > Go to the task publishing page and publish the unpublish operation to the production environment > Verify that the task is removed from the recurring tasks list in Operation Center.

Important

To ensure that downstream tasks run as expected, you can unpublish a node only if it has no downstream dependencies. If the node has downstream dependencies, the operation fails and an error is returned. For more information, see Error 2: The node has child nodes. The task cannot be deleted or unpublished.

Delete the task from the development environment

Publish the unpublish operation to the production environment

Check if the task still exists in the Production Scheduling Tasks list.

Method 1: Delete a single task

After you delete a task from the development environment in DataStudio, an unpublish record is created on the task publishing page, awaiting publication.

Method 2: Delete in batch operations

Method 2: Deleting a node group

When you unpublish a task, recurring instances that have already been generated are handled as follows:

  • Instances that have not yet started are processed as a dry-run. Their status is set to Successful, but the task code is not executed. For pay-as-you-go billing, you are not charged an instance fee for these dry-run instances.

  • Instances that are already running are not affected and continue to run until they are complete.

Important
  • You cannot manually delete instances in DataWorks. The platform automatically deletes instances after they expire, which is typically after 30 days. For more information about how existing instances are handled when a task is unpublished, see the preceding section.

  • If a task does not need to run on a specific day, you can freeze the instances generated for that day. If a task does not need to run for a period of time, you can freeze the recurring task. For more information, see Freeze (pause) a task.

Recover a task

In DataStudio, you can recover up to 100 recently deleted objects from the recycle bin. After recovery, you must submit and publish them again.

Note
  1. A new node ID is generated when you recover a node.

  2. You can recover only files (nodes, resources, and functions) that are deleted from both the development and production environments. Otherwise, an error is returned. For more information, see Error 1: Publish file ${filename} to the production environment or cancel its publication in the release center.

Error 1: Publish file ${filename} to the production environment or cancel its publication in the release center.

  • Cause: You can recover only files (such as nodes, resources, and functions) that are deleted from both the development and production environments. This error occurs if you attempt to recover a file that was deleted from the development environment, but the deletion was not published to the production environment. In this scenario, the file still exists in the production environment and cannot be recovered.

  • Solution: Go to the task publishing page and cancel the publication to restore the file in the development environment. For more information, see Cancel a publication.

Error 2: The node has child nodes. The task cannot be deleted or unpublished.

  • Cause: To ensure that downstream tasks run as expected, DataWorks lets you unpublish a task only if it has no downstream dependencies in both the development environment and the production environment.

  • Solution:

    • Check for downstream dependencies: Go to the Recurring Tasks page in Operation Center and check for downstream dependencies in both the development and production environments.

    • Remove dependencies: If the task has downstream dependencies, remove them by following the steps below.

1. Open the scheduling configuration page for the downstream task and remove its dependency on the task that you want to unpublish.

2. Submit the downstream task. This removes the dependency in the development environment.

3. Publish the downstream task. This removes the dependency in the production environment.

4. Unpublish the pending tasks. For the operation flow, see the preceding section.