> 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/october2026/resources/workflow/create-a-workflow.md).

# Create a Workflow

Define, apply, and verify a Workflow resource.

## Before you begin

Ensure you have a Compute resource and permission to use it.

You also need a stack that supports Workflow execution. For permission details, see [Workflow: Access control](https://v2.dataos.info/operate/access-control/roles-and-permissions/resource-level-permissions/workflow-access-control).

## Create a Workflow

Create a Workflow in four steps:

1. Design the DAG.
2. Add runtime settings for each step.
3. Apply the manifest.
4. Verify the run.

{% stepper %}
{% step %}

### Design the DAG

Define each step in `spec.dag`. A step runs one unit of work.

Use `depends` to define execution order. Omit `depends` for independent steps.

{% code title="workflow\.yaml" expandable="true" collapsedlinecount="12" %}

```yaml
version: v2alpha
name: ${{workflow-name}}
type: workflow
tags:
  - ${{tag1}}
description: ${{workflow-description}}
spec:
  schedule:
    crons:
      - ${{cron-expression}}
    timezone: UTC
    concurrencyPolicy: Forbid
  dag:
    - name: ${{step-name}}
      title: ${{step-title}}
      depends:
        - ${{upstream-step-name}}
      spec:
        compute: ${{compute-resource}}
        resources:
          requests:
            cpu: ${{cpu-request}}
            memory: ${{memory-request}}
          limits:
            cpu: ${{cpu-limit}}
            memory: ${{memory-limit}}
        stack: ${{stack-name}}
        stackSpec:
          ${{stack-specific-configuration}}
```

{% endcode %}

Use a single step for simple jobs. Add dependent steps for staged work.

See [Field reference](https://v2.dataos.info/references/october2026/resources/workflow/field-reference.md) for the complete Workflow manifest field reference, including DAG and step-level runtime fields.
{% endstep %}

{% step %}

### Add runtime settings

For each step, define these settings:

* `spec.dag[].spec.compute`
* `spec.dag[].spec.stack`
* `spec.dag[].spec.stackSpec`

Add `resources` to control CPU and memory. Add `use.projection` to each step's `spec` (`spec.dag[].spec.use.projection`) for secrets or configuration. Add `use.volumes` when steps share files.

Set `spec.schedule` to run automatically. Omit it for on-demand execution.
{% endstep %}

{% step %}

### Apply the manifest

Save the manifest as `workflow.yaml`. Then apply it:

```bash
dataos-ctl resource apply -f workflow.yaml
```

{% endstep %}

{% step %}

### Verify the run

Check the Workflow details:

```bash
dataos-ctl resource get -t workflow -n ${{workflow-name}} -d
```

Check runtime details:

```bash
dataos-ctl resource runtime get -t workflow -n ${{workflow-name}}
```

Inspect logs when a step fails or needs validation:

```bash
dataos-ctl resource log -t workflow -n ${{workflow-name}}
```

{% endstep %}
{% endstepper %}

## Next steps

Use [Core concepts](https://v2.dataos.info/references/october2026/resources/workflow/core-concepts.md) to learn DAGs, schedules, stacks, projections, and storage.

Use [Example](https://v2.dataos.info/references/october2026/resources/workflow/example.md) for end-to-end Workflow manifests.

Use [Field reference](https://v2.dataos.info/references/october2026/resources/workflow/field-reference.md) for complete manifest fields.


---

# 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/october2026/resources/workflow/create-a-workflow.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.
