Matthew Eng
09/24/2025, 3:00 PMMarvin
09/24/2025, 3:00 PMMarvin
09/24/2025, 3:16 PMcreate_flow_run_from_deployment
at runtime (or CI/CD scripts)
- Backlog being picked up after downtime or low capacity
- Runs were scheduled earlier but only start when a worker comes online or capacity frees up
- Another deployment or subflow calling this deployment unexpectedly
How to diagnose quickly
1) Inspect a “ghost” run’s source
- In the UI: open the flow run details and check “Triggered by” and compare “Scheduled for” vs “Start time”.
- CLI:
prefect flow-run inspect <run_id>
Look for who/what created it and when it was scheduled versus when it actually started.
2) List and verify schedules on the deployment
- See if there are multiple or overlapping schedules:
prefect deployment schedule ls "<flow_name>/<deployment_name>"
- Inspect full deployment details:
prefect deployment inspect "<flow_name>/<deployment_name>"
- If you suspect the schedule, pause it to confirm:
prefect deployment schedule pause "<flow_name>/<deployment_name>"
If runs stop, the schedule is the source. You can also remove/clear schedules:
prefect deployment schedule clear "<flow_name>/<deployment_name>"
3) Check Automations
- In the UI, open Automations and look for any with an action like “Create flow run” targeting this deployment/flow. Review recent automation runs to see if they align with your “ghost” run times.
4) Check for API/Code triggers
- Search your codebase/other flows for calls to create this deployment’s runs, e.g. create_flow_run_from_deployment
or orchestration flows that trigger this deployment.
5) Validate worker/backlog behavior
- If “Scheduled for” is earlier than “Start time,” it’s not a ghost—it’s a scheduled run being picked up later. Check worker logs and work pool capacity/concurrency; runs will start as capacity frees up.
6) Timezone and interval alignment
- For cron/rrule schedules, confirm the timezone is what you expect.
- For interval schedules, set an anchor date if you need runs aligned to a specific boundary to avoid odd offsets.
Helpful docs
- Schedules: Prefect 3.x schedules
If you can share:
- One or two example run IDs
- The deployment name
- Whether you’re on Prefect Cloud or OSS
…I can help pinpoint the exact trigger (schedule, automation, or API) and suggest the precise fix.