https://prefect.io logo
b

BK Lau

02/03/2021, 11:51 PM
Q: Are there a formal set of Prefect
lifecycle
methods or hooks or handlers for flow/tasks that user can override or register?? Something analogous or similar along this idea(https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/)
c

Chris White

02/04/2021, 12:46 AM
Hi @BK Lau - from a user perspective, the lifecycle of a task is represented by its state changes; a typical task lifecycle is Pending -> Running -> Success but there are many other paths a run might take. If you’re looking to implement custom logic in between these state changes (or even if you want to force a certain state change) you can implement task-level state handlers as described here: https://docs.prefect.io/core/concepts/notifications.html#state-handlers
👍 1
3 Views