Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,10 @@ public static class WorkflowTaskList {

private List<List<WorkflowTask>> forkTasks = new LinkedList<>();

private int // No. of seconds (at-least) to wait before starting a task.
startDelay;
/**
* No. of seconds (at-least) to wait before starting a task.
*/
private int startDelay;

private SubWorkflowParams subWorkflowParam;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@

import com.netflix.conductor.client.http.ConductorClient;
import com.netflix.conductor.client.http.WorkflowClient;
import com.netflix.conductor.common.metadata.tasks.Task;
import com.netflix.conductor.common.metadata.workflow.RerunWorkflowRequest;
import com.netflix.conductor.common.metadata.workflow.SkipTaskRequest;
import com.netflix.conductor.common.metadata.workflow.StartWorkflowRequest;
import com.netflix.conductor.common.metadata.workflow.UpgradeWorkflowRequest;
import com.netflix.conductor.common.model.BulkResponse;
Expand Down Expand Up @@ -324,4 +327,65 @@ public CompletableFuture<SignalResponse> executeWorkflowWithReturnStrategy(

return future;
}

public SearchResult<Task> getExecutionStatusTaskList(String workflowId,
Integer start,
Integer count,
List<Task.Status> status) {
return workflowResource.getExecutionStatusTaskList(workflowId, start, count, status);
}

public Map<String, List<Workflow>> getWorkflows(String name,
List<String> correlationIds,
Boolean includeClosed,
Boolean includeTasks) {
return workflowResource.getWorkflows(name, correlationIds, includeClosed, includeTasks);
}

public List<Workflow> getWorkflows(String name,
String correlationId,
Boolean includeClosed,
Boolean includeTasks) {
return workflowResource.getWorkflows(name, correlationId, includeClosed, includeTasks);
}

public SearchResult<WorkflowSummary> search(Integer start,
Integer size,
String sort,
String freeText,
String query,
Boolean skipCache) {
return workflowResource.search(start, size, sort, freeText, query, skipCache);
}

public String rerun(String workflowId, RerunWorkflowRequest rerunRequest) {
return workflowResource.rerun(workflowId, rerunRequest);
}
/**
* Resets callback times of all non-terminal SIMPLE tasks to 0
* @param workflowId the workflow id to reset callbacks for
*/
public void resetWorkflow(String workflowId) {
workflowResource.resetWorkflow(workflowId);
}

public void retryWorkflow(String workflowId, Boolean resumeSubworkflowTasks, Boolean retryIfRetriedByParent) {
workflowResource.retryWorkflow(workflowId, resumeSubworkflowTasks, retryIfRetriedByParent);
}

public void restartWorkflow(String workflowId, Boolean useLatestDefinitions) {
workflowResource.restartWorkflow(workflowId, useLatestDefinitions);
}

public void skipTaskFromWorkflow(String workflowId, String taskReferenceName, SkipTaskRequest request) {
workflowResource.skipTaskFromWorkflow(workflowId, taskReferenceName, request);
}

public List<String> getRunningWorkflow(String name, Integer version, Long startTime, Long endTime) {
return workflowResource.getRunningWorkflow(name, version, startTime, endTime);
}

public void decide(String workflowId) {
workflowResource.decide(workflowId);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,21 @@

import java.util.List;
import java.util.Map;
import java.util.Objects;

import com.netflix.conductor.client.http.ConductorClient;
import com.netflix.conductor.client.http.ConductorClientRequest;
import com.netflix.conductor.client.http.ConductorClientRequest.Method;
import com.netflix.conductor.client.http.ConductorClientResponse;
import com.netflix.conductor.common.metadata.tasks.Task;
import com.netflix.conductor.common.metadata.workflow.RerunWorkflowRequest;
import com.netflix.conductor.common.metadata.workflow.SkipTaskRequest;
import com.netflix.conductor.common.metadata.workflow.StartWorkflowRequest;
import com.netflix.conductor.common.metadata.workflow.UpgradeWorkflowRequest;
import com.netflix.conductor.common.run.SearchResult;
import com.netflix.conductor.common.run.Workflow;
import com.netflix.conductor.common.run.WorkflowSummary;
import com.netflix.conductor.common.run.WorkflowTestRequest;

import io.orkes.conductor.client.enums.Consistency;
import io.orkes.conductor.client.enums.ReturnStrategy;
Expand Down Expand Up @@ -135,6 +142,25 @@ WorkflowStatus getWorkflowStatusSummary(String workflowId, Boolean includeOutput
return resp.getData();
}

SearchResult<Task> getExecutionStatusTaskList(String workflowId,
Integer start,
Integer count,
List<Task.Status> status) {
ConductorClientRequest request = ConductorClientRequest.builder()
.method(Method.GET)
.path("/workflow/{workflowId}/tasks")
.addPathParam("workflowId", workflowId)
.addQueryParam("start", start)
.addQueryParam("count", count)
.addQueryParams("status", status.stream().map(Objects::toString).toList())
.build();

ConductorClientResponse<SearchResult<Task>> resp = client.execute(request, new TypeReference<>() {
});

return resp.getData();
}

Map<String, List<Workflow>> getWorkflowsByNamesAndCorrelationIds(CorrelationIdsSearchRequest searchRequest,
Boolean includeClosed,
Boolean includeTasks) {
Expand All @@ -152,6 +178,44 @@ Map<String, List<Workflow>> getWorkflowsByNamesAndCorrelationIds(CorrelationIdsS
return resp.getData();
}

Map<String, List<Workflow>> getWorkflows(String name,
List<String> correlationIds,
Boolean includeClosed,
Boolean includeTasks) {
ConductorClientRequest request = ConductorClientRequest.builder()
.method(Method.POST)
.path("/workflow/{name}/correlated")
.addPathParam("name", name)
.addQueryParam("includeClosed", includeClosed)
.addQueryParam("includeTasks", includeTasks)
.body(correlationIds)
.build();

ConductorClientResponse<Map<String, List<Workflow>>> resp = client.execute(request, new TypeReference<>() {
});

return resp.getData();
}

List<Workflow> getWorkflows(String name,
String correlationId,
Boolean includeClosed,
Boolean includeTasks) {
ConductorClientRequest request = ConductorClientRequest.builder()
.method(Method.GET)
.path("/workflow/{name}/correlated/{correlationId}")
.addPathParam("name", name)
.addPathParam("correlationId", correlationId)
.addQueryParam("includeClosed", includeClosed)
.addQueryParam("includeTasks", includeTasks)
.build();

ConductorClientResponse<List<Workflow>> resp = client.execute(request, new TypeReference<>() {
});

return resp.getData();
}

void uploadCompletedWorkflows() {
ConductorClientRequest request = ConductorClientRequest.builder()
.method(Method.POST)
Expand Down Expand Up @@ -252,4 +316,174 @@ SignalResponse executeWorkflowWithReturnStrategy(StartWorkflowRequest req,

return resp.getData();
}

void decide(String workflowId) {
ConductorClientRequest request = ConductorClientRequest.builder()
.method(Method.PUT)
.path("/workflow/decide/{workflowId}")
.addPathParam("workflowId", workflowId)
.build();

client.execute(request);
}

String startWorkflow(StartWorkflowRequest req) {
ConductorClientRequest request = ConductorClientRequest.builder()
.method(Method.POST)
.path("/workflow")
.body(req)
.build();

ConductorClientResponse<String> resp = client.execute(request, new TypeReference<>() {
});

return resp.getData();
}

List<String> getRunningWorkflow(String name, Integer version, Long startTime, Long endTime) {
ConductorClientRequest request = ConductorClientRequest.builder()
.method(Method.GET)
.path("/workflow/running/{name}")
.addPathParam("name", name)
.addQueryParam("version", version)
.addQueryParam("startTime", startTime)
.addQueryParam("endTime", endTime)
.build();

ConductorClientResponse<List<String>> resp = client.execute(request, new TypeReference<>() {
});

return resp.getData();
}

SearchResult<WorkflowSummary> search(Integer start,
Integer size,
String sort,
String freeText,
String query,
Boolean skipCache) {
ConductorClientRequest request = ConductorClientRequest.builder()
.method(Method.GET)
.path("/workflow/search")
.addQueryParam("start", start)
.addQueryParam("size", size)
.addQueryParam("sort", sort)
.addQueryParam("freeText", freeText)
.addQueryParam("query", query)
.addQueryParam("skipCache", skipCache)
.build();

ConductorClientResponse<SearchResult<WorkflowSummary>> resp = client.execute(request, new TypeReference<>() {
});

return resp.getData();
}

Workflow testWorkflow(WorkflowTestRequest req) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in OrkesWorkflowClient it was already there. Using Conductor WorkflowClient.

ConductorClientRequest request = ConductorClientRequest.builder()
.method(Method.POST)
.path("/workflow/test")
.body(req)
.build();

ConductorClientResponse<Workflow> resp = client.execute(request, new TypeReference<>() {
});

return resp.getData();
}

void deleteWorkflow(String workflowId, Boolean archiveWorkflow) {
Copy link
Contributor Author

@IvanKulik-sm IvanKulik-sm Aug 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

already existed in OrkesWorkflowClient

ConductorClientRequest request = ConductorClientRequest.builder()
.method(Method.DELETE)
.path("/workflow/{workflowId}/remove")
.addPathParam("workflowId", workflowId)
.addQueryParam("archiveWorkflow", archiveWorkflow)
.build();

client.execute(request);
}

String rerun(String workflowId, RerunWorkflowRequest rerunRequest) {
ConductorClientRequest request = ConductorClientRequest.builder()
.method(Method.POST)
.path("/workflow/{workflowId}/rerun")
.addPathParam("workflowId", workflowId)
.body(rerunRequest)
.build();

ConductorClientResponse<String> resp = client.execute(request, new TypeReference<>() {
});

return resp.getData();
}

/**
* Resets callback times of all non-terminal SIMPLE tasks to 0
* @param workflowId the workflow id to reset callbacks for
*/
void resetWorkflow(String workflowId) {
ConductorClientRequest request = ConductorClientRequest.builder()
.method(Method.POST)
.path("/workflow/{workflowId}/resetcallbacks")
.addPathParam("workflowId", workflowId)
.build();

client.execute(request);
}

void retryWorkflow(String workflowId, Boolean resumeSubworkflowTasks, Boolean retryIfRetriedByParent) {
ConductorClientRequest request = ConductorClientRequest.builder()
.method(Method.POST)
.path("/workflow/{workflowId}/retry")
.addPathParam("workflowId", workflowId)
.addQueryParam("resumeSubworkflowTasks", resumeSubworkflowTasks)
.addQueryParam("retryIfRetriedByParent", retryIfRetriedByParent)
.build();

client.execute(request);
}

void restartWorkflow(String workflowId, Boolean useLatestDefinitions) {
ConductorClientRequest request = ConductorClientRequest.builder()
.method(Method.POST)
.path("/workflow/{workflowId}/restart")
.addPathParam("workflowId", workflowId)
.addQueryParam("useLatestDefinitions", useLatestDefinitions)
.build();

client.execute(request);
}

void resumeWorkflow(String workflowId) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

already exists in OrkesWorkflowClient

ConductorClientRequest request = ConductorClientRequest.builder()
.method(Method.PUT)
.path("/workflow/{workflowId}/resume")
.addPathParam("workflowId", workflowId)
.build();

client.execute(request);
}

void pauseWorkflow(String workflowId) {
ConductorClientRequest request = ConductorClientRequest.builder()
.method(Method.PUT)
.path("/workflow/{workflowId}/pause")
.addPathParam("workflowId", workflowId)
.build();

client.execute(request);
}

void skipTaskFromWorkflow(String workflowId, String taskReferenceName, SkipTaskRequest requestBody) {
ConductorClientRequest request = ConductorClientRequest.builder()
.method(Method.PUT)
.path("/workflow/{workflowId}/skiptask/{taskReferenceName}")
.addPathParam("workflowId", workflowId)
.addPathParam("taskReferenceName", taskReferenceName)
.body(requestBody)
.build();

client.execute(request);
}

}
Loading
Loading