Using version_group_id ensures that even if you register a new version of the flow, the same code will still work since the version_group_id uniquely identifies a specific flow in a project.
hi @md_rafi1 - Prefect 2 is powered by a REST API instead of GraphQL. So if you want to trigger a flow run of a deployment with a http client, you can do something like:
import os
import httpx
api_url = os.getenv('PREFECT_API_URL')
headers = {
"Authorization": f"Bearer {os.getenv('PREFECT_API_KEY')}"
}
payload = {
"name": "my-new-flow-run-name", # not required
#"parameters": {} only required if your flow needs params
}
deployment_id = "<my-deployment-uuid>"
async with httpx.AsyncClient() as client:
response = await client.post(
f"{api_url}/deployments/{deployment_id}/create_flow_run",
headers=headers,
json=payload
)
response.raise_for_status()