workflows.SubmitSubtasks
go
workflows.SubmitSubtasks(
ctx context.Context,
tasks []workflows.Task,
options ...subtask.SubmitOption,
) ([]subtask.FutureTask, error)Submit multiple subtasks to the runner. Same as SubmitSubtask, but accepts a list of tasks.
This function is intended to be used in tasks.
Parameters
tasks []Task A list of tasks to submit
options []subtask.SubmitOption Options for the subtasks
Options
WithDependencies(dependencies ...FutureTask) Set dependencies for the tasks
WithClusterSlug(clusterSlug string)
Default: cluster of the runner
Set the cluster slug of the cluster where the tasks will be executed.
WithMaxRetries(maxRetries int64)
Default: 0
Set the maximum number of retries for the subtasks in case it fails
WithOptional()
Default: false
Mark the subtasks as optional. Optional subtasks will not fail the job if they fail. Tasks that depend on them will still execute even if they failed.
Returns
A list of future tasks that can be used to set dependencies between tasks.