Writing DAGs¶
Write DAGs with the schedr Python API: define tasks, pass data between them, set schedules
and run parameters, and test the result. Later pages cover outcomes, mapping, groups,
secrets, connections, cleanup, resources and events. Start with A first DAG,
or use the list below to find a topic.
These pages describe the API as it runs. How schedr works explains what happens after a DAG is stored. The Python API lists signatures; the CLI reference lists commands, and the configuration reference lists settings. Python API structure records the design, including features that are not built yet.
A DAG file is ordinary Python. Importing it records the DAGs; tasks called inside a
with Dag(...) block are recorded for later execution. The examples are tested files under
examples/, examples/docs/ and examples/showcase/, included in the pages below.
- A first DAG
- Tasks and operators
- Data flow
- Schedules
- Defaults and retries
- The DAG context
- Testing a DAG
- Routing by outcome
- Type checkers
- Mapping
- Task groups
- Run parameters
- Secrets
- Connections
- Cleaning up after a task
- Resources
- Plain scripts
- Wait steps
- Event triggers
- Acting on the first of several
- Waiting for another DAG
- Events posted by outside systems
- Starting another DAG
- Notifications
- A greenhouse, end to end