Max Eggers
03/22/2025, 3:03 AMMarvin
03/22/2025, 3:04 AMsuspend_flow_run
, the flow exits completely, and the infrastructure running it is torn down. This means that when you resume the flow with resume_flow_run
, it starts executing from the beginning. This behavior is useful for cost-saving but doesn't directly allow you to resume with new parameters without restarting the flow.
If you want to update parameters, you would need to restart the flow with the new parameters. You can manage variables through the Prefect API, CLI, or UI to facilitate this process.
For more detailed information, you can refer to the Prefect documentation on pause and resume and Prefect variables management.
If you need further guidance on implementing this with your specific stack, feel free to ask!Max Eggers
03/22/2025, 3:05 AMMarvin
03/22/2025, 3:05 AMresume_flow_run
function. This function allows you to provide a run_input
dictionary, which can contain the new parameters you wish to use when resuming the flow. Here's a brief overview of how it works:
- resume_flow_run:
- Parameters:
- `flow_run_id`: The ID of the flow run you want to resume.
- `run_input`: A dictionary of inputs to provide to the flow run. This is where you can specify the new parameters.
Here's a simplified example of how you might use it:
python
from prefect import resume_flow_run
flow_run_id = "your-flow-run-id"
new_parameters = {
"param1": "new_value1",
"param2": "new_value2"
}
resume_flow_run(flow_run_id, run_input=new_parameters)
For more details, you can check the Prefect documentation on writing flows and the source code for `resume_flow_run`.Max Eggers
03/22/2025, 3:09 AMMarvin
03/22/2025, 3:10 AM