---
title: "Create and execute a DAG-run from inline spec"
method: POST
path: "/dag-runs"
tags: ["dag-runs"]
---

# Create and execute a DAG-run from inline spec

`POST /dag-runs`

Creates a DAG-run directly from a provided DAG specification (YAML) and starts execution.

This endpoint does not require a pre-existing DAG file; the supplied `spec` is parsed and validated
similarly to `/dags/validate`, and the run is executed immediately if valid.

## Query parameters

- `remoteNode` string

## Request body

- object
  - `spec` string, required — DAG specification in YAML format
  - `name` string — Optional name to use when the spec omits a name
  - `profile` string — Runtime profile override. Empty string means no profile.
  - `params` string — Parameters to pass to the DAG-run in JSON format
  - `dagRunId` string — Optional ID for the DAG-run; if omitted, a new one is generated
  - `singleton` boolean — If true, prevent starting if a DAG with the same name is already running (returns 409)
  - `noReuse` boolean — If true, execute eligible build steps without reusing prior materializations
  - `labels` string[] — Additional labels to apply to the DAG-run (format: key=value or key-only). Merged with labels defined in the DAG spec. Mutually exclusive with deprecated `tags`; the server returns HTTP 400 if both are set.
  - `tags` string[] — Deprecated alias for Labels. Additional labels to apply to the DAG-run (format: key=value or key-only). Merged with labels defined in the DAG spec. Mutually exclusive with `labels`; the server returns HTTP 400 if both are set.

## Response `200`

Run created and started

- object
  - `dagRunId` string, required — Unique identifier for the DAG-run. The special value 'latest' can be used to reference the most recent DAG-run.

## Other responses

- `400` — Invalid DAG spec or parameters
- `409` — A DAG with the same name is already running and singleton is enabled
- `default` — Generic error response

## Changes

> 70 revisions in range; 4 could not be searched.

- **2026-08-07** (v1) `478671469a25` — 1 info
  - added the new optional request property `noReuse`
- **2026-07-23** (v1) `75b8e91aaf57` — 9 warning
  - added the new `conflict` enum value to the `code` response property for the response status `400`
  - added the new `conflict` enum value to the `code` response property for the response status `409`
  - added the new `conflict` enum value to the `code` response property for the response status `default`
  - added the new `human_task_resume_failed` enum value to the `code` response property for the response status `400`
  - …5 more
- **2026-06-02** (v1) `4a1b69f4975e` — 1 info
  - added the new optional request property `profile`
- **2026-05-24** (v1) `8a2d5d3e9608` — 3 warning
  - added the new `rate_limited` enum value to the `code` response property for the response status `400`
  - added the new `rate_limited` enum value to the `code` response property for the response status `409`
  - added the new `rate_limited` enum value to the `code` response property for the response status `default`
- …earlier changes not shown

[Full history](https://skmtc.dev/dagucloud/apis/dagu/changes/dag-runs/post.md)

---

[API](https://skmtc.dev/dagucloud/apis/dagu.md) · [All operations](https://skmtc.dev/dagucloud/apis/dagu/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/dagucloud/dagu/revisions/9fcb8e054188/schema)
