Skip to content
Skills Library
DevOps & cloud · Building & coding

workflows

/workflows

Guide for authoring Dagu workflows with YAML syntax. Use when creating workflow definitions, configuring steps and executors, or setting up scheduling and dependencies.

Licence
MIT
Last repository change
07.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
4
Scripts
0
HTML comments
0
URLs in SKILL.md
2
Deprecation

No signals detected. Repository changed on 07.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Guide for authoring Dagu workflows with YAML syntax. Use when creating workflow definitions, configuring steps and executors, or setting up scheduling and dependencies.

Original author description

Guide for authoring Dagu workflows with YAML syntax. Use when creating workflow definitions, configuring steps and executors, or setting up scheduling and dependencies.

How it works

  1. Basic Workflow Structure
  2. Steps
  3. Executors
  4. Step Dependencies
  5. Conditional Execution
  6. Error Handling and Retries
  7. Data Flow
  8. Scheduling
  9. Environment Variables
  10. Parameters
Original SKILL.md headings · 324 lines, 857 words
SKILL.md preview
---
name: workflows
description: Guide for authoring Dagu workflows with YAML syntax. Use when creating workflow definitions, configuring steps and executors, or setting up scheduling and dependencies.
---

# Dagu Workflow Authoring

This skill activates when creating or modifying Dagu workflow definitions, configuring workflow steps, scheduling, or composing complex workflows.

## Basic Workflow Structure

### Minimal Workflow

```yaml
# hello.yaml
steps:
  - name: hello
    command: echo "Hello from Dagu!"
```

### Complete Workflow Structure

```yaml
name: my_workflow
description: Description of what this workflow does

# Schedule (optional)
schedule: "0 2 * * *"  # Cron format: daily at 2 AM

# Environment variables
env:
  - KEY: value
  - DB_HOST: localhost

# Parameters
params: ENVIRONMENT=production

# Email notifications (optional)
mailOn:
  failure: true
  success: false

smtp:
  host: smtp.example.com
  port: 587

errorMail:
  from: dagu@example.com
  to: alerts@example.com

# Workflow steps
steps:
  - name: step1
    command: echo "First step"

  - name: step2
    command: echo "Second step"
    depends:
      - step1
```

## Steps

### Basic Step

```yaml
steps:
  - name: greet
    command: echo "Hello, World!"
```

### Step with Script

```yaml
steps:
  - name: process
    command: |
      echo "Starting processing..."
      ./scripts/process.sh
      echo "Done!"
```

### Step with Working Directory

```yaml
steps:
  - name: build
    dir: /path/to/project
    command: make build
```

### Step with Environment Variables

```yaml
steps:
  - name: deploy
    env:
      - ENVIRONMENT: production
      - API_KEY: $API_KEY  # From global env
    command: ./deploy.sh
```

## Executors

Command (default), Docker, SSH, HTTP, Mail, and JQ executor configuration: see `references/executors.md`.

Gotcha: the default executor (no `executor:` block) is the Command Executor — set
`executor.type` only when a step needs Docker, SSH, HTTP, Mail, or JQ.

## Step Dependencies

Simple, multiple, and parallel dependency patterns via `depends:`: see `references/steps-and-flow.md`.

Gotcha: steps with no `depends:` run in parallel by default — sequencing is opt-in.

## Conditional Execution

### Preconditions

```yaml
steps:
  - name: deploy_production
    preconditions:
      - condition: "`echo $ENVIRONMENT`"
        expected: "production"
    command: ./deploy.sh
```

### Continue On Failure

```yaml
steps:
  - name: optional_step
    continueOn:
      failure: true
    command: ./might_fail.sh

  - name: cleanup
    depends:
      - optional_step
    command: ./cleanup.sh  # Runs even if optional_step fails
```

## Error Handling and Retries

### Retry Configuration

```yaml
steps:
  - name: flaky_api_call
    command: curl https://api.example.com/data
    retryPolicy:
      limit: 3
      intervalSec: 10
```

### Exponential Backoff

```yaml
steps:
  - name: with_backoff
    command: ./external_api.sh
    retryPolicy:
      limit: 5
      intervalSec: 5
      exponentialBackoff: true  # 5s, 10s, 20s, 40s, 80s
```

### Signal on Stop

```yaml
steps:
  - name: graceful_shutdown
    command: ./long_running_process.sh
    signalOnStop: SIGTERM  # Send SIGTERM instead of SIGKILL
```

## Data Flow

Passing step output to later steps via `output:` and captured `script:` variables: see `references/steps-and-flow.md`.

## Scheduling

### Cron Schedule

```yaml
# Daily at 2 AM
schedule: "0 2 * * *"

# Every Monday at 9 AM
schedule: "0 9 * * 1"

# Every 15 minutes
schedule: "*/15 * * * *"

# First day of month at midnight
schedule: "0 0 1 * *"
```

### Start/Stop Times

```yaml
# Only run during business hours
schedule:
  start: "2024-01-01"
  end: "2024-12-31"
  cron: "0 9-17 * * 1-5"  # Mon-Fri, 9 AM to 5 PM
```

## Environment Variables

Global, step-level, and file-loaded (`.env`) environment variables: see `references/steps-and-flow.md`.

## Parameters

Defining workflow `params:` and overriding them from the CLI: see `references/steps-and-flow.md`.

## Sub-Workflows

Calling and nesting sub-workflows with `run:`: see `references/steps-and-flow.md`.

## Handlers

Exit, failure, and success handlers via `handlerOn:`: see `references/steps-and-flow.md`.

Gotcha: `handlerOn` is declared once per workflow, alongside `steps:` — it is not nested inside an individual step.

## Templates and Variables

Built-in (`{{.Name}}`, `{{.Step.Name}}`, `{{.timestamp}}`, `{{.requestId}}`) and custom `params:`-backed templates: see `references/steps-and-flow.md`.

Gotcha: custom parameters are referenced as `{{.Params.NAME}}`, not bare `{{.NAME}}` — the bare form is reserved for built-ins.

## Common Patterns

Complete ETL pipeline, multi-environment deployment, database backup, and health-check monitoring workflow artifacts: see `references/common-patterns.md`.

## Best Practices

### Workflow Organization

```yaml
# Good: Clear, descriptive names
name: user_data_sync
description: Synchronize user data from CRM to database

# Good: Logical step names
steps:
  - name: fetch_from_crm
  - name: validate_data
  - name: update_database

# Avoid: Generic names
name: workflow1
steps:
  - name: step1
  - name: step2
```

### Error Handling

```yaml
# Always define error handlers for critical workflows
handlerOn:
  failure:
    - name: cleanup
      command: ./cleanup.sh
    - name: notify
      executor:
        type: mail
        config:
          to: team@example.com

# Use retries for flaky operations
steps:
  - name: api_call
    command: curl https://api.example.com
    retryPolicy:
      limit: 3
      intervalSec: 5
      exponentialBackoff: true
```

### Environment Management

```yaml
# Use parameters for environment-specific values
params: ENVIRONMENT=development

# Load environment from files
env:
  - config/$ENVIRONMENT.env

# Override in production
# dagu start workflow.yaml ENVIRONMENT=production
```

### Modular Workflows

```yaml
# Break complex workflows into sub-workflows
steps:
  - name: data_ingestion
    run: workflows/ingestion.yaml

  - name: data_transformation
    run: workflows/transformation.yaml
    depends:
      - data_ingestion
```

## Key Principles

- **Keep workflows focused**: One workflow per logical task
- **Use dependencies wisely**: Parallelize when possible
- **Handle errors explicitly**: Define failure handlers
- **Use retries for flaky operations**: Network calls, external APIs
- **Parameterize configurations**: Make workflows reusable
- **Document workflows**: Add clear names and descriptions
- **Test workflows**: Start with small, focused workflows
- **Monitor and alert**: Use handlers to track workflow health

## References

- `references/executors.md` — Command (default), Docker, SSH, HTTP, Mail, and JQ executor configuration
- `references/steps-and-flow.md` — step dependencies, data flow, environment variables, parameters, sub-workflows, handlers, templating
- `references/common-patterns.md` — complete ETL, multi-environment deployment, backup, and monitoring workflow artifacts
Files in this package (4)
  • SKILL.md 7 KB
  • references/common-patterns.md 4 KB
  • references/executors.md 2 KB
  • references/steps-and-flow.md 4 KB

Versions

RepositoryScoreLicence
This page · vinnie357/claude-skills100MIT
phnx-labs/agi-cli100Apache-2.0
CrowdStrike/fusion-skills100MIT
manykind-ai/plugin100MIT
queelius/claude-anvil100MIT
vinnie357/claude-skills100MIT
prefecthq/prefect-mcp-server100MIT
danielmiessler/LifeOS95MIT
francoleff/Hermes-x-Google90MIT

Database snapshot: 13.11.2026 · package version bf2999ad3917 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100dagu
    Authors, validates, and troubleshoots Dagu DAG definitions and assists with Dagu CLI operations. Use when creating or debugging DAG YAML, choosing Dagu commands, or inspecting and managing DAGs and runs from the CLI.
  • 100rest-api
    Guide for using the Dagu REST API. Use when programmatically managing workflows, querying execution status, or integrating Dagu with external systems.
  • 100webui
    Guide for using the Dagu Web UI. Use when monitoring workflow executions, managing DAGs through the browser, or troubleshooting workflow issues.
  • 100kibana-workflows
    Author, validate, test, run, and inspect Elastic Workflow YAML definitions. Use when the user wants to turn natural language into a Kibana workflow, fix workflow YAML, understand triggers or steps, or run a quick test loop against a real Kibana.
  • 95ci-workflows
    Reference YAML for the canonical container-build, test, release-please and auto-fix workflow files. Use when another skill or a review needs the standard shape to cite or diff against.
  • 100expo-cicd-workflows
    Helps understand and write EAS workflow YAML files for Expo projects. Use this skill when the user asks about CI/CD or workflows in an Expo or EAS context, mentions .eas/workflows/, or wants help with EAS build pipelines or deployment automation.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.