---
title: "Jobs.Submit"
description: "Submit a job."
image: "https://tilebox.com/images/tilebox-docs-social-preview.png"
---

> Documentation Index
> Fetch the complete documentation index at: https://tilebox.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Jobs.Submit

import { Fragment } from "astro/jsx-runtime";

import ApiReference from "@docs/components/ApiReference.astro";

import ParamField from "@docs/components/ParamField.astro";

```go
func (*JobClient) Submit(
    ctx context.Context,
    jobName string,
    tasks []workflows.Task,
    options ...job.SubmitOption
) (*workflows.Job, error)
```

Submit a job.

## Parameters

**jobName**

type: string

The name of the job
**tasks**

type: []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**

type: []job.SubmitOption

Options for the job

## Options

**WithMaxRetries(maxRetries int64)**

default: 0

Set the maximum number of [retries](/docs/workflows/concepts/tasks#retry-handling) for the subtask in case it fails
**WithClusterSlug(clusterSlug string)**

default: 

The [cluster](/docs/workflows/concepts/clusters#managing-clusters) to run the root task on. If not provided, the default cluster is used.

## Returns

A job object.

<h2 id="request-example">Usage example</h2>

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

Source: https://tilebox.com/docs/api-reference/go/workflows/Jobs.Submit/index.mdx
