Skip to main content

Module task

Module task 

Source
Expand description

Tasks in DAG JSON: their kind, what they run, and their resolved settings.

Settings are stored resolved (the Python API applies StepDefaults and group defaults), so the master never needs to know where a value came from.

Structs§

EventNamed
An event posted through the API (decision 354), by name and, for a step waiting in a run, key: EventNamed("payment-completed", key=dag_ctx.params.order_id).
Mapped
One mapped argument of .expand(...): its name and the list it maps over.
OutcomeDecl
One of a task’s outcomes: its name, and for a command task the exit code meaning it.
RunOf
Which run of another DAG a step waits for, and of it which task (decision 353).
SensorWaitFor
What an @sensor(wait_for=...) / @trigger(wait_for=...) waits for, and the parameter its function is given it in (its first): a run of another DAG (RunOf, a RunResult) or an event posted (EventNamed, an Event, decision 354); exactly one of the two.
Task
A task of a DAG.
TaskCleanup
A task’s cleanup: finally for each of its attempts (see archive/PROJECT.md, Per-task cleanup).
TaskSettings
A task’s settings, resolved from its own arguments and the defaults that apply to it.

Enums§

CleanupRun
What a task’s cleanup runs: of the same kind as the task (see archive/PROJECT.md, Per-task cleanup).
CommandLine
What a command task runs.
Expand
What a mapped task’s instances vary over (decision 69): one instance per element.
ResourceRole
A command’s or a script’s part in a resource, for schedr task-ctx resource set|get.
RunIf
A task’s trigger rule: what its upstream edges must have done for it to run (see archive/PROJECT.md, Outcomes, failures and joins). An edge not taken counts as skipped.
SensorMode
How a wait step waits.
TaskKind
The kind of a task and what it runs.
WaitSource
What a SensorWaitFor waits for.

Constants§

DEFAULT_CLEANUP_RETRIES
How many times a failed cleanup is retried by default (decision 217).
DEFAULT_CLEANUP_RETRY_DELAY_MS
The default delay between a cleanup’s tries in milliseconds (decision 217).
DEFAULT_MAX_OUTPUT_SIZE
The default output size limit in bytes ([outputs] default_max_size, 1 MiB).
DEFAULT_OUTCOME
The outcome of a task without outcomes of its own (DefaultOutcome.SUCCESS).
DEFAULT_QUEUE
The queue a task goes to when it names none.
DEFAULT_RETRY_DELAY_MS
The default delay between attempts in milliseconds (5 minutes).
MAX_LAG_MS
The longest lag of a RunOf, either way: 10 years (3650 days), so a planned moment plus or minus it stays a timestamp.

Functions§

default_outcomes
A task’s outcomes when it declares none: SUCCESS, exit code 0 for a command.