---
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

---

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