leoflow_runtime.runner
Run a user task callable and capture its return value.
Return the path the task's return value is written to.
Overridable via LEOFLOW_RETURN_VALUE_PATH (primarily for tests).
Import and call module:callable, writing a non-None return as JSON.
The agent reads the file and pushes it as the task's return_value XCom.
A None return writes nothing, so downstream tasks see no XCom.
Emits three lifecycle lines so the UI's log panel is informative even when
the user function is silent: loading <entrypoint>, resolved kwargs:
{...} (when any), and returned <repr> (success) or no extra line on
raise (the agent wraps the traceback). All three use [dexaflow] prefix
via _lifecycle() so they are distinguishable from user print().
TemplateRenderError fails a task attempt whose templates cannot render.
A template that fails to render must never run as its raw {{ ... }} text
(#1845, ADR 0084): the attempt fails before execute() or bash -c, as on
Airflow. field names the template field that failed, or is None when it
cannot be identified; the message carries the Jinja error.
Render a bash command with the run context, then exec bash -c in place so
bash's stdout/stderr/exit code flow to the agent unchanged (ADR 0040). The agent
only routes a command here when it contains {{ — plain bash stays a direct
bash -c (no Python needed in bash-only images). A command that cannot render
fails the attempt without running anything (ADR 0084).
XComNotDeliveredError is raised by ti.xcom_pull for a value Dexaflow
does not deliver to the task: a custom key, a task that is not a declared
upstream, another DAG, or an upstream value too large for the environment.
Airflow would return the value; returning None instead let the task run on
with the wrong data (#2452).
NotProvidedError is raised for a context attribute Dexaflow does not provide.
The runtime builds the Airflow context itself (ADR 0040), so its task
instance, task, DAG and DAG run objects carry the attributes the runtime has
data for and no others. A provider that reaches for another one gets this
error, which names the attribute, instead of a bare AttributeError deep inside
the provider (#1843). It is an AttributeError, so hasattr and
getattr(obj, name, default) keep working. The message links the docs
section that lists what the context carries (#2474).
Instantiate and execute a captured Airflow operator/sensor (ADR 0040 Phase
A): import_string(class)(task_id, **args) → render_template_fields → execute.
The provider is installed in the task image (declared via connectors:/
dependencies:); connections resolve from AIRFLOW_CONN_* exactly as a hook's do.