VIPIN SOMA
09/05/2025, 2:21 AMMarvin
09/05/2025, 2:21 AMMarvin
09/05/2025, 2:27 AMsuspend_flow_run
) stops the run and releases infrastructure. On resume, your flow code starts from the top in a fresh process.
- Pause (pause_flow_run()
in your code) is for interactive workflows; when resumed, execution continues after the pause point (no full restart).
- Avoiding rework after a Suspend:
- Without caching/result persistence, tasks will be re-submitted and re-run.
- To skip recomputation, enable task caching and persist results:
- Set a cache key (e.g., cache_key_fn=task_input_hash
) and cache_expiration
.
- Persist results (persist_result=True
) and configure result storage. Then, on resume, previously-completed tasks with unchanged inputs can be short-circuited using their cached results.
- Running tasks at the moment of suspension are stopped; any in-memory results are lost unless persisted.
Helpful links:
- Interactive workflows (pause/resume concepts): blog post
- Core concepts (flows/states): flows concept doc
If your goal is to truly continue from “the same step,” consider using pause_flow_run()
at that point in your flow. If you’re using Suspend for cost control or manual stops, add caching + result persistence to avoid rework after resuming.
If you share a small snippet of your flow, I can suggest where to add a pause or how to configure caching/persistence for your tasks.