still wrapping my head around some concepts here, so bear with me.
I've got a a working prototype up and running which uses a flask webapp to dispatch flows to prefect cloud. Currently, I'm seeding the data (ie the tasks and flows to run) with a "bootstrap" script that needs to run before the webapp is launched, but I'd like it really to be a "batteries included" experience. How are people generally solving this? I could have a "setup" page in my flask app, but I don't want to get super involved for now
k
Kevin Kho
03/25/2022, 11:19 PM
So your flask webapp can trigger already registered flows if you do:
Copy code
Client().create_flow_run()
or you can even use the GraphQL API with native requests
As long as you register already, then you don’t need to send flow and task code. Does that make sense?
l
Lee Briggs
03/26/2022, 4:16 PM
yep, that's basically what I'm doing now. The only thing I'm struggling with is getting the flow id in order to trigger it
k
Kevin Kho
03/26/2022, 4:30 PM
Ahh I see. So you can invoke a task by calling
task.run()
. For example:
Copy code
@task
def abc():
return 1
abc.run()
This calls the Python under the hood. So I suggest you use the
create_flow_run
built-in task because the inputs are project name and flow name and it finds the id for you to trigger
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.