Cullen Baker
09/12/2025, 7:56 PMMarvin
09/12/2025, 7:57 PMMarvin
09/12/2025, 8:01 PMprefect concurrency-limit ls
prefect concurrency-limit inspect <tag>
- If you need more capacity, increase or reset the limit:
prefect concurrency-limit create <tag> <new_limit>
prefect concurrency-limit reset <tag>
- Docs: Global concurrency limits
4) Increase task-runner capacity or change runner
- By default, flows use a thread-based task runner. If you’re saturating workers, bump max_workers or switch runners:
from prefect import flow
from prefect.task_runners import ThreadPoolTaskRunner, ProcessPoolTaskRunner
@flow(task_runner=ThreadPoolTaskRunner(max_workers=16))
def my_flow():
...
# For CPU-bound workloads:
@flow(task_runner=ProcessPoolTaskRunner(max_workers=4))
def cpu_flow():
...
- Redeploy and re-run your flow after changing the task runner.
5) Avoid task-to-task blocking
- Try not to call .result() or otherwise wait on other tasks from inside a task—do that in the flow where possible. This prevents worker threads from getting stuck waiting on work that can’t start.
6) If the flow crashed/ended
- Pending tasks from a terminated flow will never start. Re-run the flow after fixing the root cause (check flow logs for exceptions).
If you’re using a distributed task runner (e.g., prefect-dask), also ensure the cluster/scheduler has available workers and is reachable.
If you can share a bit more, I can be more specific:
- Are these tasks within a single flow run that’s still Running, or did the flow fail/finish?
- Do the task state details say “AwaitingConcurrencySlot” or “waiting for upstream tasks”?
- What task runner are you using and what’s max_workers?
- Any concurrency limits configured on tags?Cullen Baker
09/12/2025, 8:17 PMMarvin
09/12/2025, 8:17 PMMarvin
09/12/2025, 8:20 PMprefect task-run ls --limit 50 --state-type COMPLETED
prefect task-run inspect <task_run_id>
prefect task-run logs <task_run_id>
- If the backend shows Completed, the UI is just stale.
2) Force the UI to refresh
- Hard refresh the page (Shift+Reload).
- Log out/in or open the run in an incognito window.
- Clear site data/local storage for your Prefect domain (app.prefect.cloud or your self-hosted domain).
- Try a different browser to rule out extensions/caching.
3) If the backend still says Pending but you see “success” logs
- Look in flow/worker logs right after the task’s last log for any “failed to update state” or API connectivity errors.
- Ensure your worker/flow process has stable network access to the API and the correct PREFECT_API_URL.
- Retry on the latest Prefect 3.x patch in case this is a fixed race-condition:
pip install -U prefect
Release notes: Latest Prefect releases
4) Self-hosted Server specifics
- Make sure API and UI come from the same Prefect version.
- Restart the server stack to clear any stale UI caches.
- Check browser devtools Network/Console for request or websocket errors to your API.
If you share:
- Cloud or self-hosted?
- Prefect version (prefect --version)
- A task/flow run ID and a screenshot of the UI state details
…I can dig in further. States reference for context: Prefect states