Zach
06/18/2024, 5:37 PMMarvin
06/18/2024, 5:37 PMpython
from prefect import task, flow, pause_flow_run
@task
async def marvin_setup():
return "A raft of ducks walk into a bar..."
@task
async def marvin_punchline():
return "It's a wonder none of them ducked!"
@flow
async def inspiring_joke():
await marvin_setup()
await pause_flow_run(timeout=600)
2. Resuming a Flow Run:
You can resume a paused flow run using the resume_flow_run
function (make sure your flow handles this correctly).
For more details, you can check the documentation:
- Prefect Flows Concepts
- Using the Client
### Issue References
- GitHub issue discussing infrastructure involved in cancellation: #9801
- Issue with automations while pausing schedules: #9177
If these functionalities do not meet your needs directly, you might have to build additional logic to handle the process yourself.
Feel free to explore the detailed documentation and issues for more edge cases. If you have any more queries, just let me know.