Workflow
Decorator that turns a function into a Datatailr DAG workflow.
The decorated function should compose @task-decorated calls. Task
dependencies are inferred automatically from the data flow between
function calls.
All parameters supplied to this decorator set the default values for
every task in the workflow. Individual tasks can override these via
their own @task arguments.
Parameters:
-
(namestr | None, default:None) –Display name of the workflow. Defaults to the decorated function name, title-cased.
-
(scheduleSchedule | None, default:None) –An optional
Schedulefor recurring execution. -
(imageImage | None, default:None) –Pre-configured container
Imageapplied to all tasks. -
(run_asstr | User | None, default:None) –User or username under which the workflow runs.
-
(resourcesResources, default:Resources(memory='100m', cpu=1)) –Default
Resources(CPU / memory) for each task. -
(aclACL | None, default:None) –Access control list for the workflow.
-
(python_versionstr, default:'auto') –Python version for the container images.
-
(python_requirementsstr | List[str], default:'') –Python dependencies (see
Image). -
(build_script_prestr, default:'') –Dockerfile commands before pip install.
-
(build_script_poststr, default:'') –Dockerfile commands after pip install.
-
(env_varsdict[str, str | int | float | bool], default:{}) –Environment variables passed to every task container.
-
(fail_aftertimedelta | str | None, default:None) –Maximum wall-clock duration before the workflow is marked as failed (e.g.
timedelta(hours=2)or"2h"). -
(expire_aftertimedelta | str | None, default:None) –Duration after which a completed workflow's resources are cleaned up.
-
(budgetBudget | str | None, default:None) –Optional spend budget for the workflow as
Budget("name")or a namestr. If not provided, will be set to the 'default' budget.
Returns:
-
Workflow(Callable) –A function that deploys the workflow to the Datatailr platform when called.
Pass any of the following keyword arguments to control the deployment:
local_run=True: execute the workflow locally.to_json=True: return the JSON representation of the workflow without deploying.save_only=True: save the workflow definition without running it.instant_run=True: run the workflow immediately without building a new image — use the default workstation image instead.
Raises:
-
ValueError–If
local_run=Trueand a schedule is set.