Skip to content

Commit

Permalink
Merge pull request #283 from conductor-oss/sub_workflow_priority
Browse files Browse the repository at this point in the history
Support priority override for sub workflows
  • Loading branch information
v1r3n authored Oct 14, 2024
2 parents a28e0e9 + 16a7c07 commit 76ed504
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ public class SubWorkflowParams {

private IdempotencyStrategy idempotencyStrategy;

// Priority of the sub workflow, not set inherits from the parent
private Integer priority;

public String getIdempotencyKey() {
return idempotencyKey;
}
Expand All @@ -61,6 +64,14 @@ public void setIdempotencyStrategy(IdempotencyStrategy idempotencyStrategy) {
this.idempotencyStrategy = idempotencyStrategy;
}

public Integer getPriority() {
return priority;
}

public void setPriority(Integer priority) {
this.priority = priority;
}

/**
* @return the name
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ public List<TaskModel> getMappedTasks(TaskMapperContext taskMapperContext) {
subWorkflowTask.addInput("workflowInput", taskMapperContext.getTaskInput());
subWorkflowTask.setStatus(TaskModel.Status.SCHEDULED);
subWorkflowTask.setCallbackAfterSeconds(workflowTask.getStartDelay());
if (subWorkflowParams.getPriority() != null) {
subWorkflowTask.setWorkflowPriority(subWorkflowParams.getPriority());
}
LOGGER.debug("SubWorkflowTask {} created to be Scheduled", subWorkflowTask);
return List.of(subWorkflowTask);
}
Expand Down

0 comments on commit 76ed504

Please sign in to comment.