Hi all - we are working on implementing a solution...
# prefect-community
Hi all - we are working on implementing a solution to send a Slack notification on flow failures with prefect 2.0. It seems like one way to do this is to capture the flow state via the following:
Copy code
def entrypoint():
    raise ValueError("my error message")

if __name__ == "__main__":
    state = entrypoint(return_state=True)
In this scenario,
can give us the detailed error message for passing back into Slack which seems really useful. However, it’d also be great if we can also provide a direct link to the flow using the flow’s run id. How are other folks implementing this, and is there a way to directly access the flow’s run id after calling the flow from main (or otherwise)?
The flow run id is available at
Perfect, thank you Michael!
Michael - while I have your attention, we are hoping to just use Prefect Cloud’s notification feature (https://docs.prefect.io/ui/notifications/) to accomplish this but unfortunately it’s lacking for this task since it does not pass an error message, or the flow run’s URL. I notice there is an open feature request here (https://github.com/PrefectHQ/prefect/issues/6424) which is similar but I’m not sure covers the functionality that we’re hoping for. Should I file a new feature request for this, or add a comment to this existing one?
A separate issue seems reasonable, just link to that one and explain how it’s different
Will do, thanks again.