Jackson Nguyen
09/22/2025, 11:24 PMMarvin
09/22/2025, 11:24 PMMarvin
09/22/2025, 11:28 PMprefect deployment run
can watch the run’s state but does not stream logs into your terminal.
What you can do:
- Watch the run status
- prefect deployment run <FLOW>/<DEPLOYMENT> --watch
- This keeps the command open until the run reaches a terminal state, but it won’t stream logs.
- Docs: prefect deployment CLI
- View logs after triggering a run
- Get the run ID from the output of prefect deployment run
, then:
- prefect flow-run logs <RUN_ID>
- There’s no live “follow” flag, but you can approximate tailing:
- while true; do clear; prefect flow-run logs <RUN_ID> --tail -n 200; sleep 2; done
- Docs: prefect flow-run CLI
- Stream logs by running the worker in the foreground
- If you start your worker in your terminal, you’ll see your flow’s logs there when it picks up the run:
- prefect worker start -p <WORK_POOL_NAME>
- In another terminal, trigger the run:
- prefect deployment run <FLOW>/<DEPLOYMENT> --watch
- The run will not execute until a worker is running.
- Advanced: execute a specific run locally
- If you already have a run ID and the environment to execute it, you can run:
- prefect flow-run execute <RUN_ID>
- This will execute the run in your terminal and stream logs, similar to what a worker does.
If you share your version (2.x vs 3.x) and how you’re running deployments (worker type, local vs remote), I can tailor the best option for your setup.