Essay

Local-first workflow orchestration

Hosted orchestrators keep your schedules and run state in their cloud while your workers poll it. Dagu keeps both on the machine that runs the work, in plain files, with no database. What local-first means for a workflow orchestrator.

Yota Hamada
Share

TL;DR Dagu aims to be a local-first base from which a small team runs and manages a large number of complex workflows. Its scheduler, queue, run history, and logs live in plain files on your own servers, with no database, so nothing outside those servers decides whether a scheduled run starts. Dagu Cloud, the paid control plane, shows all your servers in one place, and runs do not depend on it.

I'm Yota Hamada. Since April 2022 I have been building Dagu, a local-first workflow orchestrator: one open-source binary that keeps its schedules, run history, and logs on the servers you run.

The goal is a base from which a small team can run and manage a large number of complex workflows, all from one place, without depending on any service outside its own servers. The logo draws it as a cockpit.

Dagu's banner: a hamster pilots a small spaceship, beside the line Built for teams whose main work is not orchestration

What it does:

  • Runs the shell scripts, containers, and SSH commands you already have, from a YAML file, with schedules, retries, dependencies, and a Web UI.
  • Ships as one binary that holds the scheduler, the Web UI, the coordinator, and the workers. Nothing else is installed beside it: no database, no message broker.
  • Runs the same YAML on one machine or across a fleet of workers.

It started with cron jobs

Dagu started with a problem I had at an enterprise company: maintaining a complex data pipeline that ran on a large number of cron jobs. A README from May 2022 described the code behind it:

Our ETL pipeline is already hundreds of thousands of lines of complex code in Perl and shell scripts. Adding another layer of Python on top of this would make it even more complicated.

Cron ran each job on its schedule and nothing more. It did not know which job depended on which, what to do when one failed, or what had run the night before. Airflow knew all of that, but wanted every workflow rewritten in Python, with a metadata database and a set of services beside it. I wanted something that ran the existing scripts as they were and needed nothing else installed.

The first README, committed on 22 April 2022 when the project was still called jobctl, described it as a tool for managing the DAGs that cron ran, and listed among its features:

Simple architecture (no DBMS or agent process is required)

A database server is one more thing that has to be up before a job can start. Dagu still does not have one. Installing it means copying a binary, and all of its state is files in a directory.

Orchestration as a separate layer

Python and SDK-based orchestrators put the workflow inside the code. In Airflow's TaskFlow API, a Python function marked @dag becomes a DAG, and functions marked @task become its tasks. Prefect turns a function into a flow with @flow and into a task with @task. In Dagster, a function marked @asset joins the asset graph, with its dependencies taken from its parameters. Temporal workflows are written against its SDK, and a workflow definition must be deterministic so it can be replayed, so calls to other systems have to move into separate activities.

In each of these, the orchestration logic, meaning what runs after what, what is retried, and what happens on failure, lives in the same code as the work itself. The work has to be written in the orchestrator's language, import its library, and follow its rules, and moving to another orchestrator means rewriting it.

Dagu keeps the two apart. The workflow logic stays in your scripts, containers, and commands, in whatever language they are written in. The orchestration logic, meaning order, dependencies, retries, schedules, and approvals, goes in a YAML file beside them, and each step names only the command to run:

# when to run
schedule: "0 * * * *"
steps:
  - id: extract
    # your script, unchanged
    run: ./extract.sh
    # retry up to 3 times
    retry_policy:
      limit: 3
      interval_sec: 60
  - id: load
    # runs after extract
    depends: [extract]
    # your script, unchanged
    run: python load.py

The scripts never import Dagu. They take their input from arguments and environment variables, report success or failure with their exit code, and can still be run by hand. Delete the YAML and they run as before.

That was the point for the pipeline above: hundreds of thousands of lines of Perl and shell could stay as they were, with the orchestration added around them instead of written into them.

What local-first means for an orchestrator

This is what is now usually called local-first. The term comes from Local-first software, a 2019 essay from Ink & Switch by Martin Kleppmann, Adam Wiggins, Peter van Hardenberg, and Mark McGranaghan. It was written about documents and design tools, and set out seven ideals for them, among them working offline, keeping data for the long term, and staying in control of it after the vendor is gone. In his talk at the first Local-First Conf, in Berlin in 2024, Kleppmann proposed a shorter test: in local-first software, the availability of another computer should never prevent you from working.

For a workflow orchestrator, the test is whether anything other than the machine that runs a workflow can stop it from starting on time.

Hosted orchestrators split the work differently. Prefect's page for its cloud puts the split as "Prefect Cloud hosts the Control Plane & Metadata. You host execution & data." In Dagster+ Hybrid, the web frontend, the API, the metadata database, and the daemons "responsible for executing schedules and sensors" are hosted in Dagster+. Temporal Cloud "stores Workflow state and schedules the work" while your workers run your code. In each, your code and data stay with you, and your workers poll the vendor's service to find out what to run next.

That split decides what happens when the vendor's service fails or changes. On 31 March 2026, Temporal Cloud reported that some customers in AWS us-west-2 "may experience delayed execution of schedules", and the incident stayed open for about 11 hours. In 2023, Prefect froze legacy Prefect Cloud 1 accounts on its free and monthly plans: a frozen account became read-only, and its flows stopped running. Moving them to the newer Prefect meant changing the flow code itself, because it was written against Prefect 1's library.

Dagu keeps the scheduler, the queue, run state, history, logs, and secrets on servers you run. A server with no internet connection runs its schedules as usual, and air-gapped servers can use an offline license. The Web UI reads run history from local disk; on my machine, a page of 100 workflows out of 1,000 loads in 24 to 45 ms. Run history is JSON on disk, so you can read it with cat even after Dagu is uninstalled. Logs, outputs, and secrets stay on your servers unless one of your workflows sends them out. Dagu Cloud, the optional control plane, adds monitoring and alerting across the servers you connect to it. If Dagu Cloud shut down, every server would keep running its schedules.

How Dagu keeps all of that in files instead of a database, and what that cost, is in Why Dagu has no database.

The cloud is optional

A single server needs no database because everything it knows is its own. With several servers, some questions span all of them: which workflow failed last night and on which server, or which server stopped reporting an hour ago. Answering those takes one place that every server reports to, and that place does use a database.

That place is Dagu Cloud, the control plane for your servers, and its paid plans fund Dagu. It does not change how a server runs. Each server's own scheduler still starts its runs. Servers send run metadata over outbound HTTPS, and only after an administrator turns reporting on; if Dagu Cloud cannot be reached, reporting retries later and scheduled runs start as usual. Logs, outputs, and secrets stay on the server, and the monitoring post lists what is sent. If a license expires, workflows keep running, and only paid features such as SSO and audit logging turn off until it is renewed.

The engine is free and open source under GPLv3, and it runs every schedule without Dagu Cloud.

Feedback

I want to hear what a local-first workflow orchestrator should do for you. Which parts of your operations still run outside one, and what would it take to manage them from Dagu?

I also want to hear how a local-first workflow orchestrator should work with AI, and what you would want AI to do with your workflows.

Install Dagu or read the code, and tell me on Discord, on X, or in GitHub issues.

· · ·

Written by

Yota Hamada

Contributor to the Dagu project.

More from Yota Hamada