Hi, I’ve been playing with Prefect Core for the pa...
# prefect-community
s
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
Hi @Shawn Marhanka, If you're looking to query for your flow names and IDs, something like this should do the trick:
Copy code
client.graphql(
    {
        'query': {
            'flow': {
                'id',
                'name'
            }
        }
    }
)
Does that look like it'd do the trick for you?
s
Ahh nice! thanks so much @Zachary Hughes. I think that will work.
z
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
Thank you 🙂