github dagu-org/dagu v1.29.0

15 hours ago

Changelog

Added

  • Spec: Added logOutput field at DAG and step levels to control stdout/stderr logging behavior - separate (default) writes to separate .out/.err files, merged writes both to a single .log file with interleaved output (#1505)
  • DAG Run Outputs Collection: Collect step outputs into a structured outputs.json file per DAG run. View collected outputs in the Web UI via the new Outputs tab. (#1466)
    • Outputs are automatically collected from steps with output field
    • Secret values are automatically masked in outputs
    • Enhanced output field syntax supports object form with name, key, and omit options:
steps:
  # Simple string form (existing behavior)
  - name: get-count
    command: echo "42"
    output: COUNT

  # Object form with custom key
  - name: get-version
    command: cat VERSION
    output:
      name: VERSION
      key: appVersion  # Custom key in outputs.json (default: camelCase of name)

  # Object form with omit
  - name: internal-step
    command: echo "value"
    output:
      name: TEMP
      omit: true  # Exclude from outputs.json but still usable in DAG
  • API endpoint: GET /api/v2/dag-runs/{name}/{dagRunId}/outputs
  • See DAG Run Outputs for details.
  • UI: Added wrap/unwrap toggle button in log viewer for better readability of long lines
  • API Key Management: Added comprehensive API key management for programmatic access with role-based permissions. API keys provide a secure alternative to static tokens with fine-grained access control.
    • Create, list, update, and delete API keys via Web UI or REST API
    • Role-based permissions (admin, manager, operator, viewer) per key
    • Usage tracking with lastUsedAt timestamp
    • Secure key generation with bcrypt hashing
    • Keys use dagu_ prefix for easy identification
    • Web UI management at Settings > API Keys (admin only)
    • Full REST API at /api/v2/api-keys endpoints
# Create an API key
curl -X POST http://localhost:8080/api/v2/api-keys \
  -H "Authorization: Bearer $JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name": "ci-pipeline", "role": "operator"}'

# Use the API key
curl -H "Authorization: Bearer dagu_your-key-here" \
  http://localhost:8080/api/v2/dags

Requires builtin authentication mode (auth.mode: builtin). See API Keys documentation for details.

  • Webhook Management: Added DAG-specific webhooks for triggering workflow executions from external systems like CI/CD pipelines, GitHub, and Slack.
    • Create, regenerate, enable/disable, and delete webhooks via Web UI or REST API
    • DAG-specific tokens (one webhook per DAG) with dagu_wh_ prefix
    • Payload passthrough via WEBHOOK_PAYLOAD environment variable
    • Idempotent execution support with custom dagRunId
    • Usage tracking with lastUsedAt timestamp
    • Secure token storage with bcrypt hashing
    • Full REST API at /api/v2/webhooks and /api/v2/dags/{fileName}/webhook endpoints
# Create a webhook for a DAG
curl -X POST http://localhost:8080/api/v2/dags/my-dag/webhook \
  -H "Authorization: Bearer $JWT_TOKEN"

# Trigger DAG via webhook with payload
curl -X POST http://localhost:8080/api/v2/webhooks/my-dag \
  -H "Authorization: Bearer dagu_wh_your-webhook-token" \
  -H "Content-Type: application/json" \
  -d '{"payload": {"branch": "main", "commit": "abc123"}}'

Requires builtin authentication mode (auth.mode: builtin). See Webhooks documentation for details.

  • Multiple Commands per Step: Steps can now execute multiple commands sequentially using an array syntax. This allows sharing step configuration (env, workingDir, retryPolicy, preconditions, container, etc.) across multiple commands instead of duplicating it across separate steps.
steps:
  - name: build-and-test
    command:
      - npm install
      - npm run build
      - npm test
    env:
      - NODE_ENV: production
    workingDir: /app

Commands run in order and stop on first failure. Retries restart from the first command (no checkpoint/resume from middle).

Supported executors: shell, command, docker, container, ssh. Executors that do not support multiple commands (jq, http, archive, mail, github_action, dag) will reject the configuration at parse time.

Fixed

  • Config: Fixed errorMail and infoMail partial field overrides not working when only specifying prefix or attachLogs without from/to fields. Previously, single-field overrides were silently ignored. (#1512)
  • Config: Fixed smtp partial field overrides not working when only specifying username or password without host/port fields.

Full Changelog: v1.28.0...v1.29.0

Don't miss a new dagu release

NewReleases is sending notifications on new releases.