Skip to main content
func (*JobClient) Submit(
    ctx context.Context,
    jobName string,
    tasks []workflows.Task,
    options ...job.SubmitOption
) (*workflows.Job, error)
Submit a job.

Parameters

jobName
string
The name of the job
tasks
[]Task
The root task for the job. This task is executed first and can submit subtasks to manage the entire workflow. A job can have optionally consist of multiple root tasks.
options
[]job.SubmitOption
Options for the job

Options

WithMaxRetries(maxRetries int64)
default:"0"
Set the maximum number of retries for the subtask in case it fails
WithClusterSlug(clusterSlug string)
default:""
The cluster to run the root task on. If not provided, the default cluster is used.

Returns

A job object.
job, err := client.Jobs.Submit(ctx,
    "My job",
    []workflows.Task{rootTask},
)