Start a workflow
You can use this operation to start a z/OSMF workflow on a z/OS system. The workflow to be started must contain at least one automated step.
HTTP method and URI path
PUT /zosmf/workflow/rest/<version>/workflows/<workflowKey>/operations/start
- <version> identifies the version of the z/OSMF workflow service. The following value is valid: 1.0.
- <workflowKey> identifies the workflow to be started.
Query parameters
None.
Description
This operation is used to start an automated workflow, that is, a workflow with at least one step that can be performed automatically. For information about designing an automated workflow, see Automated steps.
On successful completion, HTTP status code 202 (Accepted) is returned. If you specify a notification URL in your request, a JSON object is posted to the URL when automation stops; the format of the object is described in Content that is posted to the notification URL.
This request must be submitted from the user ID of the step owner for the automated step. Otherwise, the request ends with HTTP status code 400 and an error message. Also, if used with a workflow that contains no automated steps, the request ends with HTTP status code 400 and an error message.
Request content
Your request can contain a JSON object that specifies options for starting the workflow. The request content is optional; it can be omitted or be empty. If so, default values are used for any optional properties that can be specified.
Field name | Type | Required or optional | Description |
---|---|---|---|
resolveConflictByUsing | String | Optional | Indicates how variable conflicts, if any, are
to be handled when the Workflows task reads
in the output file from a step that runs a REXX exec or UNIX shell
script. The following values are valid for this parameter:
If you omit this property, the default is outputFileValue. |
stepName | String | Optional | The name of the step at which automation is to begin. If you omit this property, automation processing begins with the first step in the workflow. |
performSubsequent | Boolean | Optional | If the workflow contains any subsequent automated steps, this property indicates whether z/OSMF is to perform the steps. If you set this property to true, or omit the property, z/OSMF attempts to perform the automated steps. If you set this property to false, z/OSMF attempts to perform the specified step only. The default is true. |
notificationUrl | String | Optional | A notification URL (up to 2000 characters). Depending on the requirements of your application, you might want to receive a notification when the automated step or steps reach an end state (either completion or failure). Suppose, for example, that your application includes a servlet that is to be given control on completion of the automated steps. If so, you can optionally specify a notification URL to be posted when automation ends. Your installation must add this URL to the list of allowable sites. Work with your security administrator to create the appropriate authorization; see Allowing cross-site access to REST services. If specified, this URL receives a JSON object with the result of the automation processing. For the format of the JSON object, see Table 3. |
Authorization requirements
HTTP status codes
On successful completion, HTTP status code 202 (Accepted) 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.
HTTP error status code | Description |
---|---|
HTTP 400 Bad request | The request contained incorrect parameters.
For example:
|
HTTP 404 Not found | The specified workflow key was not found; the workflow does not exist. |
HTTP 409 Request conflict | Request cannot be performed automatically because
the specified workflow has one of the following statuses:
|
Additional standard status codes can be returned, as described in HTTP status codes.
Content that is posted to the notification URL
Field name | Type | Description |
---|---|---|
instanceURI | String | Specifies the URI path of the workflow that was being automated. You can use the URI path to retrieve more details about the workflow. |
statusName | String | Indicates the current workflow status after automation has stopped. The following are the possible values
that might be returned after a stopped automation:
|
startUser | String | User ID of the user who initiated the automation processing. |
startedTime | Timestamp | Time that automation processing started. |
stoppedTime | Timestamp | Time that automation processing stopped. |
currentStepName | String | Name of the step that caused automation to stop. If the workflow status is complete, this property is set to null. |
currentStepNumber | String | The step number. If the workflow status is complete, this property is set to null. |
currentStepTitle | String | Step title. If the workflow status is complete, this property is set to null. |
messageID | String | This property contains the message identifier that helps identify the reason that automation is stopped. |
messageText | String | This property contains the message text associated with the message identifier found in messageID. |
Example HTTP interaction
PUT /zosmf/workflow/rest/1.0/workflows/d043b5f1-adab-48e7-b7c3-d41cd95fa4b0/operations/start HTTP/1.1
Host: zosmf1.yourco.com
Connection: close
Content-Type: application/json
Content-Length: 3
Authorization: Basic em9zbWZhZDp6b3NtZmFk
{}
HTTP/1.1 202 Accepted
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:29:55 GMT
content-type: application/json; charset=UTF-8