jobAction

Click to copy

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:

ParameterDescriptionData Type
typeRequired. The action enum is Hold.String
stepIdsOptional. 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
holdScheduledReleaseOptional. 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
dependentJobIdOptional. A job that the current job is dependent on from being performed step actions including Run and Finish.String
dependentStepIdOptional. The step in the job that the current job is dependent on from being performed step actions including Run and Finish.String

ReleaseHold Parameters:

ParameterDescriptionData Type
typeRequired. The action enum is ReleaseHold.String
stepIdsOptional. The array of steps on hold to be released. If not specified the release is applied to all the steps on hold.Array
dependentJobIdOptional. The manual hold can be released without specifying dependentJobId. The dependency hold must be released by specifying the dependent job ID.String
dependentStepIdOptional. The manual hold can be released without specifying dependentStepId. The dependency hold must be released by specifying the dependent step ID.String

Body parameter

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
{
  "type": "Finish",
  "stepIds": [
    "string"
  ],
  "holdScheduledRelease": "2019-08-24T14:15:22Z",
  "dependentJobId": "string",
  "dependentStepId": "string"
}

Query parameters

NameTypeRequired

token

string

Path parameters

NameTypeRequired

jobId

string

orgId

string

itemId

string

Examples

Request

Use dark colors for code blocksCopy
1
2
3
4
5
# 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

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
{
  "success": true,
  "stepResponses": [
    {
      "stepId": "string",
      "status": "Success",
      "statusDescription": "The step was started running"
    }
  ]
}
StatusMeaningDescriptionSchema

200

OK

success

JobActionResponse

400

Bad Request

error

WorkflowJsonExceptionDTO

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.