> For the complete documentation index, see [llms.txt](https://v2.dataos.info/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://v2.dataos.info/references/resources/workflow/field-reference.md).

# Field reference

Reference for Workflow manifest fields and DAG step configuration.

Use this page to look up Workflow manifest fields, required values, and nested options.

## Top-level fields

| Field         | Description                                      | Required |
| ------------- | ------------------------------------------------ | -------- |
| `version`     | API version of the Workflow resource.            | Yes      |
| `name`        | Unique name of the Workflow.                     | Yes      |
| `type`        | Resource type. Set this to `workflow`.           | Yes      |
| `tags`        | Labels used for grouping and filtering.          | No       |
| `description` | Short summary of the Workflow.                   | No       |
| `spec`        | Main configuration block for execution settings. | Yes      |

## `spec` fields

| Field                             | Description                                                                                                                                                                 | Required                            |
| --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------- |
| `spec.type`                       | Execution mode for the Workflow: `instance`, `schedule`, or `template`. Defaults to `schedule` when `spec.schedule` is set, otherwise `instance`. See Execution mode below. | No                                  |
| `spec.dependencies`               | Resource-level prerequisites before execution starts.                                                                                                                       | No                                  |
| `spec.schedule`                   | Scheduling configuration for automatic execution. Required when `spec.type` is `schedule`.                                                                                  | No                                  |
| `spec.schedule.crons`             | One or more cron expressions for run timing.                                                                                                                                | Yes, when `spec.schedule` is set    |
| `spec.schedule.timezone`          | Time zone used to evaluate the cron schedule.                                                                                                                               | Yes, when `spec.schedule` is set    |
| `spec.schedule.concurrencyPolicy` | Controls whether overlapping runs are allowed: `Allow`, `Forbid`, or `Replace`. Has no default.                                                                             | Yes, when `spec.type` is `schedule` |
| `spec.dag`                        | List of batch steps in the Workflow DAG.                                                                                                                                    | Yes                                 |

## Execution mode (`spec.type`)

`spec.type` sets how the whole Workflow runs: once, on a schedule, or only when you trigger it. It does not change how individual DAG steps are configured; `stack`, `compute`, `stackSpec`, and the other step fields work the same for every `spec.type`.

{% hint style="info" %}
`spec.type` is not the same as the top-level `type` field. The top-level `type: workflow` names the DataOS Resource kind. `spec.type` sets how that Workflow is executed.
{% endhint %}

| Value      | Behavior                                                                                                                  | Use when                                                               |
| ---------- | ------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| `instance` | Runs the DAG once each time the Workflow is applied or re-run.                                                            | You need a one-off or on-demand batch job, with no cron.               |
| `schedule` | Runs the DAG on each cron in `spec.schedule.crons`. Requires `spec.schedule`, including `concurrencyPolicy`.              | You need a recurring job, such as a nightly ETL or a periodic report.  |
| `template` | Registers the Workflow definition without running it on apply. Start a run with the run or re-run action on the Workflow. | You reuse the same DAG many times and run it only when you trigger it. |

Any other value is rejected at validation.

**Default:** if you omit `spec.type`, it defaults to `schedule` when `spec.schedule` is set (with `crons`), and to `instance` otherwise.

**Restrictions:**

* Use resource version `v2alpha` for this `spec` shape.
* Each DAG step must use a stack that supports Workflow jobs. `spec.type` does not limit which stack you can use.
* All steps in one Workflow must use Compute on the same Data Plane. Jobs run on the Data Plane of each step's Compute.
* Only `schedule` uses `spec.schedule` for execution. With `instance` or `template`, a cron in `spec.schedule` does not trigger runs.
* With `spec.type: schedule` and `concurrencyPolicy: Allow`, DAG steps cannot attach persistent volumes.

**Examples:**

{% tabs %}
{% tab title="instance" %}
{% code title="run-once.yaml" %}

```yaml
version: v2alpha
type: workflow
name: run-once
spec:
  type: instance
  dag:
    - name: step-a
      spec:
        runAsUser: ${RUN_AS_USER}
        compute: runnable-default
        stack: container
        stackSpec:
          image: docker.io/library/alpine:3.20
          command: [sh, -c]
          arguments: ["echo once"]
```

{% endcode %}

Omitting `spec.type` (with no `spec.schedule`) behaves the same way.
{% endtab %}

{% tab title="schedule" %}
{% code title="run-nightly.yaml" %}

```yaml
version: v2alpha
type: workflow
name: run-nightly
spec:
  type: schedule
  schedule:
    crons:
      - "0 2 * * *"
    timezone: UTC
    concurrencyPolicy: Forbid
  dag:
    - name: step-a
      spec:
        runAsUser: ${RUN_AS_USER}
        compute: runnable-default
        stack: container
        stackSpec:
          image: docker.io/library/alpine:3.20
          command: [sh, -c]
          arguments: ["echo nightly"]
```

{% endcode %}
{% endtab %}

{% tab title="template" %}
{% code title="run-on-demand.yaml" %}

```yaml
version: v2alpha
type: workflow
name: run-on-demand
spec:
  type: template
  dag:
    - name: step-a
      spec:
        runAsUser: ${RUN_AS_USER}
        compute: runnable-default
        stack: container
        stackSpec:
          image: docker.io/library/alpine:3.20
          command: [sh, -c]
          arguments: ["echo on demand"]
```

{% endcode %}

After you apply it, start a run with the run or re-run action on the Workflow.
{% endtab %}
{% endtabs %}

## `spec.dag[]` fields

| Field                | Description                               | Required |
| -------------------- | ----------------------------------------- | -------- |
| `spec.dag[].name`    | Name of an individual step.               | Yes      |
| `spec.dag[].title`   | Optional human-readable title for a step. | No       |
| `spec.dag[].depends` | Step dependencies inside the DAG.         | No       |
| `spec.dag[].spec`    | Runtime configuration for that step.      | Yes      |

## `spec.dag[].spec` fields

| Field                                | Description                                      | Required |
| ------------------------------------ | ------------------------------------------------ | -------- |
| `spec.dag[].spec.compute`            | Compute target used for the step.                | Yes      |
| `spec.dag[].spec.resources.requests` | Minimum CPU and memory requested for execution.  | No       |
| `spec.dag[].spec.resources.limits`   | Maximum CPU and memory allowed for execution.    | No       |
| `spec.dag[].spec.runAsUser`          | User identity used to run the step.              | No       |
| `spec.dag[].spec.use.volumes`        | Mounted volumes available to the step.           | No       |
| `spec.dag[].spec.use.projection`     | Injected secrets and configuration for the step. | No       |
| `spec.dag[].spec.stack`              | Runtime stack used to execute the step.          | Yes      |
| `spec.dag[].spec.stackSpec`          | Stack-specific configuration details.            | Yes      |

## Notes

* Model the DAG first, then choose the runtime for each step.
* Use `spec.schedule` only when the Workflow should run automatically.
* Define `use.projection` under each step (`spec.dag[].spec.use.projection`). The Workflow top-level `spec` has no `use` field, so a projection placed there is silently dropped.
* Steps do not inherit projections. Repeat the projection in each step that needs it, or use the stack's projection when every job on that stack needs the same values.
* In each projection item, set the content in `template`. There is no `value` field.

For behavior and usage guidance, see [Core concepts](https://v2.dataos.info/references/resources/workflow/core-concepts.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://v2.dataos.info/references/resources/workflow/field-reference.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
