Closed
Description
Hello Metaflow Team,
I am exploring ways to automate Metaflow workflows and have a query regarding the initial execution of these workflows via a Python script. Specifically, I'm interested in whether it is possible to execute a Metaflow workflow directly from a script without explicitly using the run argument for the first time.
Could you provide guidance or confirm if there's a recommended approach for initializing and running workflows programmatically without the run command? Any insights on setting up the environment or script adjustments to handle this use case would be greatly appreciated.
from metaflow import FlowSpec, step
class ExampleFlow(FlowSpec):
@step
def start(self):
print("This is the start step.")
self.next(self.end)
@step
def end(self):
print("This is the end step.")
if __name__ == '__main__':
# How to initiate this flow without using 'ExampleFlow().run()'?
# HelloFlow 인스턴스 생성
flow = ExampleFlow()
graph = flow._graph
current_steps = ['start']
while current_steps:
next_steps = []
for current_step in current_steps:
print(f"Running step: {current_step}")
run_step(flow, current_step)
next_steps.extend(step.__name__ for step in flow._next_steps)
print("Next steps:", next_steps)
current_steps = next_steps
Thank you for your assistance!
Metadata
Metadata
Assignees
Labels
No labels
Activity