Tasks
A task is finite work that runs to completion: a migration, a seed, a fixture load. Other nodes can wait for it to finish.
const migrate = defineTask({
name: 'migrate',
run: 'pnpm migrate',
dependsOn: [db.available],
env: () => ({ DATABASE_URL: db.outputs.connectionString({ database }) }),
teardown: `dropdb --if-exists ${database}`,
});A task is available when it exits 0, so a service that writes dependsOn: [migrate.done] starts only after the migration succeeded. For a task, .done and .available are the same edge. A service that must restart whenever the migration runs again also lists it in restartOn.
teardown runs when the instance is removed, in reverse dependency order, so db is still running when it fires. Without it, every abandoned worktree leaves a database behind forever.
Running a task by hand
Any node may be start: 'manual', which keeps it in the graph — named, ordered, visible — while declining to run it until you ask. A plain alzo up skips it; a manual node inside a closure you explicitly requested does run, and Alzo says so. Include a manual task in nodes even when nothing depends on it, because a node that nothing reaches is an error.
alzo up db --wait
alzo run migratealzo run runs a task against the running environment after verifying that its dependencies are ready; it refuses, naming them, when they are not. alzo up migrate --wait instead starts the dependencies and runs the task. Arguments after -- are appended to the task's command: alzo run seed -- --size=small. A task with a container image runs as one fresh container, and while it runs, a run of another task with a container image in the same instance refuses.
Tasks in CI
alzo ci starts the graph, waits for it, runs a task or a command and tears everything down, exiting with that result:
alzo ci e2e
alzo ci -- npm testEveryday development covers running tests against a development graph.