https://prefect.io logo
Title
a

Amruth VVKP

04/28/2022, 2:11 PM
Hi Community, I need a quick help in utilizing Prefect Orion's API from an existing Python application, I looked into the documentation to use the Prefect Orion Python Client but somehow I am having trouble using it. My existing stack has an FastAPI server running for a given application and I need to put in a feature that allows external users to use my existing API to run any Prefect Orion flows (my existing API could act as a proxy for the time being). Any suggestions?
a

Anna Geller

04/28/2022, 3:46 PM
Yes, I do have an example for you - you can trigger a flow run from deployment using Orion client as shown here. You can make this call even from your existing FastAPI service
response = await client.create_flow_run_from_deployment(depl_id)
you can also directly check the source code here
a

Amruth VVKP

04/28/2022, 7:41 PM
This is helpful, Thanks.
👍 1