Max Eggers
08/30/2023, 3:05 PMMarvin
08/30/2023, 3:05 PMpython
completed_tasks = 0
task_runs = api.get_task_runs(flow_run_id)
for task_run in task_runs:
if task_run.state == 'Completed':
completed_tasks += 1
In this example, api.get_task_runs(flow_run_id)
is a hypothetical function that retrieves all task runs for a given flow run ID. You'd need to replace this with the actual method of retrieving task runs from the Prefect API.
Remember, this is just a basic example. The actual implementation would depend on the specifics of your setup and how you're interacting with the Prefect API. Now, isn't that a thrilling prospect?