Use prefect 2.0 state icons for custom notifications

I would like to customize flow notifications in webhooks so as to include the state icons (as seen in the prefect UI).
Those ones:
completed

For that however, they need to be accessible online (via URL) to be integrated as an image in a webhook.
After some digging, I found out the state icons were created inline by the UI (via svg html code).

Would it be possible to upload those icons as svg images accessible online, perhaps on the prefect 2.0 documentation website?

1 Like

Interesting! Just to clarify: you want to introduce custom named states and set custom icons that are displayed for them in the UI flow run dashboard/filter? is that correct?

No no, I want to use existing states/icons outside of the prefect server UI. Typically inside custom webhooks or any type of notifications.

For now, the only notification handled directly through the Orion server (SlackWebhook) consists of text only, and is quite inflexible. I would like to make it prettier and more adaptable, depending on the need.

Though, being able to create and register custom states and icons would be awesome as well, it is a different topic altogether.

Not sure I understand the use case then. In your notifications, perhaps you could just use emojis? :smile:

it might be useful if you share the code and explain what you are doing, how you’re doing it and what’s missing to satisfy that use case

I simply want to use the same state icons as used in the prefect orion server, but outside of it.
I could use anything else, but I prefer to keep the prefect style for the icons if possible (for visual coherence’s sake).

all_states

The problem is those are not accessible, but hidden inside the orion UI server code, but to use them in notifications I need an URL pointing towards them.

For now, I am using :white_check_mark: to indicate a flow has completed, :x: if it has failed.

1 Like

Gocha, I think we may look at making similar icons accessible more broadly. For now, I think your solution with :white_check_mark: and :x: works best