---
title: "Enqueue a DAG-run from inline spec"
method: POST
path: "/dag-runs/enqueue"
tags: ["dag-runs"]
---

# Enqueue a DAG-run from inline spec

`POST /dag-runs/enqueue`

Creates a DAG-run directly from a provided DAG specification (YAML) and enqueues it for 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 persisted to the queue 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 persist with the queued DAG-run in JSON format
  - `dagRunId` string — Optional ID for the DAG-run; if omitted a new one will be generated
  - `queue` string — Override the queue to use for this DAG-run
  - `singleton` boolean — If true, prevent enqueuing if DAG is already running or queued (returns 409 conflict)
  - `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`

DAG-run successfully enqueued

- 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` — DAG is already running or queued (singleton mode), or dagRunId already exists
- `default` — Generic error response

## Changes

- **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`
- **2026-04-30** (v1) `50e1d517afc1` — 1 warning, 3 info
  - removed the request property `profile`
  - removed the `rate_limited` enum value from the `code` response property for the response status `400`
  - removed the `rate_limited` enum value from the `code` response property for the response status `409`
  - removed the `rate_limited` enum value from the `code` response property for the response status `default`

[Change history](https://skmtc.dev/dagucloud/apis/dagu/changes/dag-runs/enqueue/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/162df20bbef8/schema)
