https://prefect.io logo
Title
s

Shawn Marhanka

07/22/2020, 9:59 PM
Hi, I’ve been playing with Prefect Core for the past few weeks and recently moved over to experimenting with Prefect Cloud. We currently have all of our prefect flows/tasks in a separate repo. If we register all of the flows in that repo and use docker storage, can other apps in our ecosystem programmatically call those flows once they have authenticated to Prefect Cloud. I found
client.create_flow_run(flow_id, parameters=parameters)
, but I cannot find how to get the flow_id without registering. Is there a way to get all of the flow mappings (name + id) from a cloud project and then use that when creating flow runs. Or am I going about this all wrong? Thanks for the help.
z

Zachary Hughes

07/22/2020, 10:36 PM
Hi @Shawn Marhanka, If you're looking to query for your flow names and IDs, something like this should do the trick:
client.graphql(
    {
        'query': {
            'flow': {
                'id',
                'name'
            }
        }
    }
)
Does that look like it'd do the trick for you?
s

Shawn Marhanka

07/22/2020, 11:28 PM
Ahh nice! thanks so much @Zachary Hughes. I think that will work.
z

Zachary Hughes

07/23/2020, 12:14 AM
Awesome! And if you're looking specifically to kick off a flow run from an existing flow, take a look at the Flow Run Task-- should do a lot of the hard work for you! https://docs.prefect.io/api/latest/tasks/prefect.html#flowruntask
👍 1
s

Shawn Marhanka

07/23/2020, 4:08 PM
Thank you 🙂