Hi there, how do I configure a Slack Webhook autom...
# ask-community
h
Hi there, how do I configure a Slack Webhook automation to include the last line of output from any failed tasks? In Prefect 1 we had slack notifications such as:
Failed
Propagate Affinity merges / deletions is now in a Failed state
Message
Copy code
AssertionError('Some items failed to merge')
Now the best I can get is:
<flow> in state
Failed
Flow run <flow>/fiery-hyrax observed in state
Failed
at 2023-06-23T190401.492402+00:00.
Flow run URL: https://app.prefect.cloud/.../
State message: 1/1 states failed.
from the config:
Copy code
# Subject
{{ flow.name }} in state `{{ flow_run.state.name }}`

# Body
Flow run {{ flow.name }}/{{ flow_run.name }} observed in state `{{ flow_run.state.name }}` at {{ flow_run.state.timestamp }}.
Flow run URL: {{ flow_run|ui_url }}
State message: {{ flow_run.state.message }}
Is it possible to improve upon the "State message" part as this is not very informative? Or is this not available in the variables that can be accessed from this context. If that's the case how would we include this information if we built something to send a notification on failure ourselves?