Skip to content

Task

Decorator that marks a function as a workflow task (batch job).

Use this via the public alias @task() to declare individual computational steps inside a @workflow-decorated function.

Parameters:

Name Type Description Default
memory str

Memory limit for this task's container (e.g. "256m", "1g").

DEFAULT_TASK_MEMORY
cpu float

Number of CPU cores to allocate for this task (e.g. 1, 0.5).

DEFAULT_TASK_CPU

Returns:

Type Description

A decorator that wraps the target function so it can participate

in DAG-based workflow orchestration.

Example
from datatailr import task

@task(memory="512m", cpu=2)
def heavy_computation(x, y):
    return x ** y