These examples show how another Go application can import Dagu as a library:
import "github.com/dagucloud/dagu"The embedded API is experimental. It is intended for applications that want to run Dagu DAGs in-process or dispatch them to existing Dagu coordinators while keeping Dagu's CLI and server behavior unchanged.
Run a DAG in the current process with file-backed state:
go run ./examples/embedded/localThe example creates a temporary Dagu home directory, loads
examples/embedded/local/workflow.yaml, passes parameters, waits for completion,
and prints the final status.
Register a process-local executor and use it from DAG YAML:
go run ./examples/embedded/custom-executorThis is useful when the embedding application already has domain-specific Go code and wants DAG steps to call that code without shelling out.
Run against an existing Dagu coordinator:
DAGU_COORDINATORS=127.0.0.1:50055 go run ./examples/embedded/distributedThe example starts an embedded worker and dispatches a DAG through the
coordinator. Set DAGU_COORDINATORS to a comma-separated list when using more
than one coordinator. The sample opts into plaintext coordinator transport for
local development; production embedders should provide TLS files instead.