@ syntax) and can be applied to step methods or flow classes.
Step Decorators
Step decorators modify the behavior of individual steps in your flow. They control where and how steps execute, handle failures, set timeouts, and more.Execution Environment
- @step - Declares a method as a step in the flow
- @batch - Execute step on AWS Batch
- @kubernetes - Execute step on Kubernetes
- @resources - Specify compute resources (CPU, memory, GPU)
Error Handling
- @retry - Automatically retry failed steps
- @timeout - Set execution time limits
- @catch - Gracefully handle step failures
Environment Configuration
- @environment - Set environment variables
- @card - Generate visual reports
Flow Decorators
Flow decorators modify the behavior of the entire flow and are applied to theFlowSpec class.
- @project - Organize flows into projects with namespaces
Usage
Decorators are applied using Python’s@ syntax:
Decorator Order
When using multiple decorators on a step, the order matters:- Error handling decorators (
@retry,@catch) should be at the top - Environment decorators (
@batch,@kubernetes,@resources) come next - The
@stepdecorator must always be the last decorator (closest to the method)
Using —with
Many decorators can be applied dynamically at runtime using the--with command-line option:
