Task
class, allowing explicit specification of properties like result_type
, user_access
, and context
.
@flow
decorator for overall workflow structure with the flexibility of Task
for individual task definition.
@flow
decorator for defining workflows. This provides a simple, intuitive way to structure your workflow as a function with clear inputs and outputs.
For tasks, we recommend most users start with imperative Task
objects. This approach allows for more dynamic task creation and fine-grained control over task properties. It also lets your workflow benefit from lazy execution optimizations, which can enhance performance.
However, the functional API is a great choice for simple tasks where you want to quickly define a task with minimal boilerplate.