Hi team,
im stuck in running my existing flows via python client, which method is used for run the existing flows ?
code :
import asyncio
from prefect.client import get_client
client = get_client()
async def get_flows():
client = get_client()
r = await client.read_flows(limit=5)
return r
async def my(r):
for flow in r:
print("flow detail", flow.__dict__)
print(flow.name, flow.id)
# **how to run this flow now ?**
if __name__ == "__main__":
r = asyncio.run(get_flows())
asyncio.run(my(r))
response:
flow detail {'id': UUID('cbb43cad-7761-4941-ae07-5b79efd508e2'), 'created': DateTime(2023, 11, 28, 11, 49, 18, 244284, tzinfo=Timezone('+00:00')), 'updated': DateTime(2023, 11, 28, 11, 49, 18, 244284, tzinfo=Timezone('+00:00')), 'name': 'hello-sir', 'tags': []}
hello-sir cbb43cad-7761-4941-ae07-5b79efd508e2
flow detail {'id': UUID('b9724a59-d56e-4db3-a68c-ee212d76c98d'), 'created': DateTime(2023, 11, 28, 7, 23, 1, 316489, tzinfo=Timezone('+00:00')), 'updated': DateTime(2023, 11, 28, 7, 23, 1, 316489, tzinfo=Timezone('+00:00')), 'name': 'hello-world', 'tags': []}
hello-world b9724a59-d56e-4db3-a68c-ee212d76c98d
flow detail {'id': UUID('9f75be73-b07d-4ffa-ab27-d83d955cc4b2'), 'created': DateTime(2023, 11, 28, 7, 37, 11, 181946, tzinfo=Timezone('+00:00')), 'updated': DateTime(2023, 11, 28, 7, 37, 11, 181946, tzinfo=Timezone('+00:00')), 'name': 'hello-world2', 'tags': []}
hello-world2 9f75be73-b07d-4ffa-ab27-d83d955cc4b2
flow detail {'id': UUID('8b2b5477-afc5-4a81-aee0-6771beb5a6cc'), 'created': DateTime(2023, 11, 28, 8, 59, 44, 931924, tzinfo=Timezone('+00:00')), 'updated': DateTime(2023, 11, 28, 8, 59, 44, 931924, tzinfo=Timezone('+00:00')), 'name': 'something-else', 'tags': []}
something-else 8b2b5477-afc5-4a81-aee0-6771beb5a6cc
i tried this
await client.start_flow_run(flow_id=flow.id)
but this gives me below error
AttributeError: ‘PrefectClient’ object has no attribute ‘start_flow_run’