Q: Are there a formal set of Prefect `lifecycle` ...
# prefect-community
b
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
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