Commits
Click on a commit to change the comparison rangefeat: add prefect deployment export CLI command
Implements a new CLI command to export deployment configurations from the
Prefect server to a YAML file. This is the inverse of 'prefect deploy' -
instead of turning a YAML file into deployments, it connects to Prefect
and outputs deployment configs as YAML.
Features:
- Export a single deployment with --name <flow>/<deployment>
- Export all deployments with --all
- Customize output path with --output (must be .yaml or .yml)
- Interactive mode: prompts for output path, defaults to prefect.yaml
- Non-interactive mode: requires --output flag
- Prompts for confirmation before overwriting existing files
The exported YAML includes:
- name, version, description, entrypoint
- tags, parameters, enforce_parameter_schema
- work_pool configuration (name, work_queue_name, job_variables)
- schedules (with active status and max_scheduled_runs)
- concurrency_limit settings
- pull steps
Closes #19742
Co-Authored-By: Nate Nowack <nate@prefect.io>13 hours ago
by devin-ai-integration[bot] refactor: use existing DeploymentConfig/PrefectYamlModel schemas for export
Address PR feedback:
- Changed output parameter from Optional[str] to Optional[Path] for stronger typing
- Refactored _deployment_response_to_yaml_dict to _deployment_response_to_config
which returns a DeploymentConfig instead of a dict
- Use PrefectYamlModel to wrap deployment configs and model_dump for serialization
- This reuses the same schema that prefect deploy uses, keeping YAML shape centralized
Co-Authored-By: Nate Nowack <nate@prefect.io>13 hours ago
by devin-ai-integration[bot]