Job actions
Performs actions on one or more steps based on the action enum provided. If no stepId is provided, the action will be performed on the current step(s). The action enum can be as follows:
- Run: Starts running a step. Running a step marks it as finished, if the step is set to proceed to next.
- Finish: Finishes running a step, and proceeds to the next step.
- Stop: Stops running a step, then the step can be Run again or Finish can be used to complete it. In case of GP step and question step, the processing of the step is cancelled. In case of manual and open app step, the step is paused. The step can be forced to stop by a user not assigned to the step with the jobForceStop privilege.
- SetCurrentStep: Sets a single step to be the active step on the job. The ability to set a step as current is controlled by the workflowSetStepCurrent privilege.
- Hold: Applies a hold or a dependency to a step. The Run and Finish actions cannot be performed on the step until the dependent step is resolved, the ReleaseHold action is run, or the holdScheduledReleased has expired. If there is not a holdScheduledReleased timestamp, the ReleaseHold action is required to remove the hold or dependency. If there are multiple holds or dependencies, they must all be released or expired for the Run and Finish actions to be performed. Cannot be applied if the step is already running or job is closed.
- ReleaseHold: Releases a hold from a step, allowing the Run and Finish actions to be once again performed on the step.
- RefreshStatus: Refreshes the step status. Only the users with adminBasic or adminAdvanced privilege or job assigned user can refresh the status for the step.
The step will not be started, stopped, finished or set as current step under the following conditions:
- Not assigned to the current user
- No active step is defined
- The job is closed
- A step that cannot be skipped and has not been started or has been cancelled, will not be finished
- A step cannot be set current if the job is running.
- A step that has one or more holds will not run nor finish.
Hold Parameters:
Parameter | Description | Data Type |
---|---|---|
type | Required. The action enum is Hold. | String |
stepIds | Optional. The array of steps put on hold when adding a dependency hold. If not specified, the dependency hold is applied to all the active steps in the job. | Array |
holdScheduledRelease | Optional. The release timestamp for a scheduled hold. Once the current date and time has passed the scheduled release timestamp, the hold will automatically release without requiring the ReleaseHold action. | String |
dependentJobId | Optional. A job that the current job is dependent on from being performed step actions including Run and Finish. | String |
dependentStepId | Optional. The step in the job that the current job is dependent on from being performed step actions including Run and Finish. | String |
ReleaseHold Parameters:
Parameter | Description | Data Type |
---|---|---|
type | Required. The action enum is ReleaseHold. | String |
stepIds | Optional. The array of steps on hold to be released. If not specified the release is applied to all the steps on hold. | Array |
dependentJobId | Optional. The manual hold can be released without specifying dependentJobId. The dependency hold must be released by specifying the dependent job ID. | String |
dependentStepId | Optional. The manual hold can be released without specifying dependentStepId. The dependency hold must be released by specifying the dependent step ID. | String |
Body parameter
{
"type": "Finish",
"stepIds": [
"string"
],
"holdScheduledRelease": "2019-08-24T14:15:22Z",
"dependentJobId": "string",
"dependentStepId": "string"
}
Query parameters
Name | Type | Required |
---|---|---|
|
|
Path parameters
Name | Type | Required |
---|---|---|
|
| |
|
| |
|
|
Examples
Request
# You can also use wget
curl -X POST /{orgId}/{itemId}/jobs/{jobId}/action \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
Response
200 Response
{
"success": true,
"stepResponses": [
{
"stepId": "string",
"status": "Success",
"statusDescription": "The step was started running"
}
]
}
Status | Meaning | Description | Schema |
---|---|---|---|
| success | ||
| error |