Class WorkflowClient
java.lang.Object
com.netflix.conductor.client.http.WorkflowClient
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a default workflow clientWorkflowClient(ConductorClient client) WorkflowClient(ConductorClient client, ConductorClientConfiguration config) -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckAndUploadToExternalStorage(StartWorkflowRequest startWorkflowRequest) voiddeleteWorkflow(String workflowId, boolean archiveWorkflow) Removes a workflow from the systemgetRunningWorkflow(String workflowName, Integer version) Retrieve all running workflow instances for a given name and versiongetWorkflow(String workflowId, boolean includeTasks) Retrieve a workflow by workflow idgetWorkflows(String name, String correlationId, boolean includeClosed, boolean includeTasks) Retrieve all workflows for a given correlation id and namegetWorkflowsByTimePeriod(String workflowName, int version, Long startTime, Long endTime) Retrieve all workflow instances for a given workflow name between a specific time periodvoidpauseWorkflow(String workflowId) Pause a workflow by workflow idvoidpopulateWorkflowOutput(Workflow workflow) Populates the workflow output from external payload storage if the external storage path is specified.voidregisterListener(WorkflowClientListener listener) rerunWorkflow(String workflowId, RerunWorkflowRequest rerunWorkflowRequest) Reruns the workflow from a specific taskvoidresetCallbacksForInProgressTasks(String workflowId) Resets the callback times of all IN PROGRESS tasks to 0 for the given workflowvoidRestart a completed workflowvoidresumeWorkflow(String workflowId) Resume a paused workflow by workflow idvoidretryLastFailedTask(String workflowId) Retries the last failed task in a workflowvoidrunDecider(String workflowId) Starts the decision task for the given workflow instancePaginated search for workflows based on payloadSearch for workflows based on payloadPaginated search for workflows based on payloadSearch for workflows based on payloadvoidsetRootURI(String rootUri) Deprecated.voidskipTaskFromWorkflow(String workflowId, String taskReferenceName) Skips a given task from a current RUNNING workflowstartWorkflow(StartWorkflowRequest startWorkflowRequest) Starts a workflow.voidterminateWorkflow(String workflowId, String reason) Terminates the execution of the given workflow instanceterminateWorkflows(List<String> workflowIds, String reason) Terminates the execution of all given workflows instancestestWorkflow(WorkflowTestRequest testRequest)
-
Constructor Details
-
WorkflowClient
public WorkflowClient()Creates a default workflow client -
WorkflowClient
-
WorkflowClient
-
-
Method Details
-
setRootURI
Deprecated.Kept only for backwards compatibility- Parameters:
rootUri- basePath for the ApiClient
-
registerListener
-
startWorkflow
Starts a workflow. If the size of the workflow input payload is bigger thanExternalPayloadStorage, if enabled, else the workflow is rejected.- Parameters:
startWorkflowRequest- theStartWorkflowRequestobject to start the workflow- Returns:
- the id of the workflow instance that can be used for tracking
-
checkAndUploadToExternalStorage
-
getWorkflow
Retrieve a workflow by workflow id- Parameters:
workflowId- the id of the workflowincludeTasks- specify if the tasks in the workflow need to be returned- Returns:
- the requested workflow
-
getWorkflows
public List<Workflow> getWorkflows(String name, String correlationId, boolean includeClosed, boolean includeTasks) Retrieve all workflows for a given correlation id and name- Parameters:
name- the name of the workflowcorrelationId- the correlation idincludeClosed- specify if all workflows are to be returned or only running workflowsincludeTasks- specify if the tasks in the workflow need to be returned- Returns:
- list of workflows for the given correlation id and name
-
deleteWorkflow
Removes a workflow from the system- Parameters:
workflowId- the id of the workflow to be deletedarchiveWorkflow- flag to indicate if the workflow should be archived before deletion
-
terminateWorkflows
Terminates the execution of all given workflows instances- Parameters:
workflowIds- the ids of the workflows to be terminatedreason- the reason to be logged and displayed- Returns:
- the
BulkResponsecontains bulkErrorResults and bulkSuccessfulResults
-
getRunningWorkflow
Retrieve all running workflow instances for a given name and version- Parameters:
workflowName- the name of the workflowversion- the version of the wokflow definition. Defaults to 1.- Returns:
- the list of running workflow instances
-
getWorkflowsByTimePeriod
public List<String> getWorkflowsByTimePeriod(String workflowName, int version, Long startTime, Long endTime) Retrieve all workflow instances for a given workflow name between a specific time period- Parameters:
workflowName- the name of the workflowversion- the version of the workflow definition. Defaults to 1.startTime- the start time of the periodendTime- the end time of the period- Returns:
- returns a list of workflows created during the specified during the time period
-
runDecider
Starts the decision task for the given workflow instance- Parameters:
workflowId- the id of the workflow instance
-
pauseWorkflow
Pause a workflow by workflow id- Parameters:
workflowId- the workflow id of the workflow to be paused
-
resumeWorkflow
Resume a paused workflow by workflow id- Parameters:
workflowId- the workflow id of the paused workflow
-
skipTaskFromWorkflow
Skips a given task from a current RUNNING workflow- Parameters:
workflowId- the id of the workflow instancetaskReferenceName- the reference name of the task to be skipped
-
rerunWorkflow
Reruns the workflow from a specific task- Parameters:
workflowId- the id of the workflowrerunWorkflowRequest- the request containing the task to rerun from- Returns:
- the id of the workflow
-
restart
Restart a completed workflow- Parameters:
workflowId- the workflow id of the workflow to be restarteduseLatestDefinitions- if true, use the latest workflow and task definitions when restarting the workflow if false, use the workflow and task definitions embedded in the workflow execution when restarting the workflow
-
retryLastFailedTask
Retries the last failed task in a workflow- Parameters:
workflowId- the workflow id of the workflow with the failed task
-
resetCallbacksForInProgressTasks
Resets the callback times of all IN PROGRESS tasks to 0 for the given workflow- Parameters:
workflowId- the id of the workflow
-
terminateWorkflow
Terminates the execution of the given workflow instance- Parameters:
workflowId- the id of the workflow to be terminatedreason- the reason to be logged and displayed
-
search
Search for workflows based on payload- Parameters:
query- the search query- Returns:
- the
SearchResultcontaining theWorkflowSummarythat match the query
-
searchV2
Search for workflows based on payload- Parameters:
query- the search query- Returns:
- the
SearchResultcontaining theWorkflowthat match the query
-
search
public SearchResult<WorkflowSummary> search(Integer start, Integer size, String sort, String freeText, String query) Paginated search for workflows based on payload- Parameters:
start- start value of pagesize- number of workflows to be returnedsort- sort orderfreeText- additional free text queryquery- the search query- Returns:
- the
SearchResultcontaining theWorkflowSummarythat match the query
-
searchV2
public SearchResult<Workflow> searchV2(Integer start, Integer size, String sort, String freeText, String query) Paginated search for workflows based on payload- Parameters:
start- start value of pagesize- number of workflows to be returnedsort- sort orderfreeText- additional free text queryquery- the search query- Returns:
- the
SearchResultcontaining theWorkflowthat match the query
-
testWorkflow
-
populateWorkflowOutput
Populates the workflow output from external payload storage if the external storage path is specified.- Parameters:
workflow- the workflow for which the output is to be populated.
-