Yu(Irene) Chen
05/15/2026, 1:58 AMMarvin
05/15/2026, 1:58 AMMarvin
05/15/2026, 2:00 AMawait, it should stop around the timeout
- if the code is sync and doing a blocking network call, it may keep running until that call returns or errors, then Prefect exits the flow
- it generally will not continue to the rest of the flow normally after the timeout; it will fail once control returns to Prefect
Example idea:
python
from prefect import flow, task
import requests
@task
def download():
requests.get("<https://example.com/large-file>") # blocking call
@flow(timeout_seconds=10)
def my_flow():
download()
print("next step")
If download() blocks for 60 seconds:
- the flow timeout hits at 10 seconds
- but the requests.get(...) call may not stop immediately
- once that blocking call finishes, Prefect will raise the timeout and the flow will fail
- next step likely will not run
Best practice: also set a timeout on the network call itself, not just the flow.
python
requests.get("<https://example.com/large-file>", timeout=10)
If you want, I can show you the best pattern for task-level download timeouts + retries in Prefect.