@step decorator declares a method as a step in your Metaflow flow. Every step in a flow must be decorated with @step.
Basic Usage
Description
The@step decorator:
- Identifies methods that should be executed as steps in the workflow
- Must be the decorator closest to the method definition (after any other decorators)
- Is required for every method that participates in the flow graph
Step Requirements
Every step must:- Be a method of a
FlowSpecsubclass - Have the
@stepdecorator - Call
self.next()to transition to the next step(s), except for the final step
Transitions
Steps transition to other steps usingself.next():
Linear Transitions
Branching (foreach)
Conditional Branching
Combining with Other Decorators
The@step decorator must be the last decorator applied:
Special Steps
Start Step
Every flow must have a step namedstart:
End Step
Every flow must have a step namedend that doesn’t call self.next():
