How can I delete all flows from my workspace? When deleteing a flow, will Prefect delete the flow runs of that flow too?

Yes, deleting a flow will also delete all flow runs associated with that flow.

To delete all flows from your workspace or Orion instance, you can use:

import asyncio
from prefect.client import get_client


async def remove_all_flows():
    orion_client = get_client()
    flows = await orion_client.read_flows()
    for flow in flows:
        flow_id = flow.id
        print(f"Deleting flow: {flow.name}, {flow_id}")
        await orion_client._client.delete(f"/flows/{flow_id}")
        print(f"Flow with UUID {flow_id} deleted")


if __name__ == "__main__":
    asyncio.run(remove_all_flows())

Note that this will delete not only the flow but also all flow runs created for that flow.

The assumption here is that if you would want to keep the run history for that flow, you would keep the flow, and if you delete a flow, you also want to clear all runs corresponding to that flow (cascade behavior).