Hello there! I'm trying to use for the first time...
# ask-community
m
Hello there! I'm trying to use for the first time the prefect automation system to send notification to a custom webhook of mine when a particular flow completes. I'm having troubles in understanding where I should put the "payload of the notification", i don't get if it is something that I should define in the automation -> actions -> body or I should leave this empty (or with the default values) and put the payload into the webhook -> JSON data. In the first case, I've tried and I get:
Copy code
13:44:29.389 | WARNING | prefect.server.events.actions - Action failed: "The notification block was invalid: 1 validation error for CustomWebhookNotificationBlock\nparams\n  Input should be a valid dictionary [type=dict_type, input_value='', input_type=str]\n    For further information visit <https://errors.pydantic.dev/2.10/v/dict_type>"
using this the default values as automation body:
Copy code
Flow run {{ flow.name }}/{{ flow_run.name }} observed in state {{ flow_run.state.name }} at {{ flow_run.state.timestamp }}.
Flow ID: {{ flow_run.flow_id }}
Flow run ID: {{ flow_run.id }}
Flow run URL: {{ flow_run|ui_url }}
State message: {{ flow_run.state.message }}
In the second case, If I try to set in the webhook JSON body something like:
Copy code
{
"flow_run_id": {{ flow_run.flow_id }}
}
when saving the block from the GUI this modification is not applied (it only happens for the JSON part, not for all the other params. If I do it in other fields i.e. Form params I get that this templating is not allowed. I'm sure I'm missing something, thanks to everyone that will provide a clarification 🙂
👍 1
c
Having the same issue
m
@Marvin