https://prefect.io logo
#prefect-server
Title
# prefect-server
a

Alexander van Eck

07/19/2022, 3:38 PM
Question on dynamically creating flows; Say I have 3 tasks
Copy code
@task
def task_1():
  print('1')

@task
def task_2():
  print('2')

@task
def task_3():
  print('3')
And I wanted to give the user the ability to say in which order these should be executed, or who should consume which one. i.e. I want to user to describe a graph of these callables and then for the flow to execute them. How would I do this?
k

Kevin Kho

07/19/2022, 3:42 PM
I think you can’t in Prefect 1 because it violates the DAG model. You could in Prefect 2 though
a

Alexander van Eck

07/19/2022, 3:42 PM
Understood, mostly interested in prefect 2! 🙂 any tips?
k

Kevin Kho

07/19/2022, 3:44 PM
You can do this as you would in normal Python pretty much
7 Views