---
title: "Trigger DAG execution via webhook"
method: POST
path: "/webhooks/{fileName}"
tags: ["webhooks"]
---

# Trigger DAG execution via webhook

`POST /webhooks/{fileName}`

Triggers a DAG execution via webhook. The DAG must have a webhook configured
and enabled. Authentication depends on the webhook auth mode:
bearer token only, bearer token plus HMAC, or HMAC only.

The request body is passed to the DAG as the WEBHOOK_PAYLOAD environment
variable. If the DAG configures `webhook.forward_headers`, selected
request headers are passed as the WEBHOOK_HEADERS environment variable.
For safety, the `Authorization` header is never forwarded.
The DAG run is enqueued and the endpoint returns immediately with the
dag-run ID.

## Path parameters

- `fileName` string, regex, required — Name of the DAG file

## Query parameters

- `remoteNode` string

## Headers

- `Authorization` string
- `X-Dagu-Signature` string
- `X-Dagu-Profile` string — Runtime profile name.

## Request body

- WebhookRequest — Request body for webhook trigger endpoint
  - `dagRunId` string — Optional idempotency key. If provided and a DAG run with this ID already exists, the endpoint returns 409 Conflict. If not provided, a new UUID is generated.
  - `payload` object — Arbitrary JSON payload to pass to the DAG as WEBHOOK_PAYLOAD

## Response `200`

DAG run triggered successfully

- WebhookResponse — Response from webhook trigger endpoint
  - `dagRunId` string, required — Unique identifier for the DAG-run. The special value 'latest' can be used to reference the most recent DAG-run.
  - `dagName` string, required — Name of the triggered DAG

## Other responses

- `400` — Invalid request body
- `401` — Unauthorized - missing or invalid token, or invalid/missing X-Dagu-Signature when strict HMAC enforcement is active
- `403` — Forbidden - webhook disabled or not configured
- `404` — DAG or webhook not found
- `409` — Conflict - DAG run with the specified dagRunId already exists
- `default` — Unexpected error

---

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