Delete a workflow

You can use this operation to remove a z/OSMF workflow from a z/OS system.

HTTP method and URI path

DELETE /zosmf/workflow/rest/<version>/workflows/<workflowKey>
In this request, the URI path variables are described, as follows:
  • <version> identifies the version of the z/OSMF workflow service. The following value is valid: 1.0.
  • <workflowKey> identifies the workflow to be deleted.

Query parameters

None.

Description

This operation is used to delete a workflow from z/OSMF, including any notes that accompany the workflow and its steps, and the history log for the workflow. Deleting a workflow does not undo any actions that were performed on the system as part of the workflow. If you delete a workflow, you are responsible for undoing manually any changes on the system that you no longer require. Ensure that all applicable back-out procedures are followed. See your workflow provider for this information.

This request is failed for a workflow with the status Automation in Progress. That is, it is not possible to delete the workflow while an automated step is running. You must either allow the processing to complete, or you can stop the processing through the Workflows task.

You cannot delete a called workflow, that is, a workflow that is in-progress as a result of being called by another workflow for execution. For design considerations for called workflows, see Calling steps.

Request content

None.

Authorization requirements

This request is available to the workflow owner only. A delete request from another user is rejected with the HTTP status code 403 (Forbidden) and an appropriate error message in the JSON response object.

For other authorization requirements, see Authorization requirements.

HTTP status codes

On successful completion, HTTP status code 204 (No content) is returned.

Otherwise, the following HTTP status codes are returned for the indicated errors. The response body is a standard error response body providing the reason code that is indicated and associated error message.

Table 1. HTTP error response codes for a delete workflow request
HTTP error status code Description
HTTP 403 Forbidden The request was submitted from a user ID that is not the workflow owner.
HTTP 404 Not found The specified workflow key was not found; the workflow does not exist.
HTTP 409 Request conflict The request cannot be processed because the workflow has the status Automation in Progress.

Additional standard status codes can be returned, as described in HTTP status codes.

Response content

None.

Example HTTP interaction

In the following example, the DELETE method is used to delete a workflow. Here, the workflow is identified by the workflow key, which is the following string value: d043b5f1-adab-48e7-b7c3-d41cd95fa4b0.
Figure 1. Sample request to delete a workflow
DELETE /zosmf/workflow/rest/1.0/workflows/d043b5f1-adab-48e7-b7c3-d41cd95fa4b0 HTTP/1.1
Host: zosmf1.yourco.com
Connection: close
Authorization: Basic em9zbWZhZDp6b3NtZmFk
For a successful request, the HTTP response 204 is returned.
Figure 2. Sample response from a delete workflow request
HTTP/1.1 204 No Content
content-length: 0
content-language: en-US
x-powered-by: Servlet/3.0
server: WebSphere Application Server
connection: Close
date: Wed, 11 Feb 2015 18:30:34 GMT
content-type: application/json; charset=UTF-8