Alex Cannon
04/27/2022, 5:41 PMKevin Kho
04/27/2022, 5:42 PMAlex Cannon
04/27/2022, 5:42 PMAnna Geller
04/27/2022, 5:42 PMmutation {
create_action(input: {config: {create_flow_run: {flow_group_id: "b097b505-f4b3-401d-9e69-87eccbcc0794"}}}) {
id
}
}
this returns action_id
#2 Once you’ve got an action_id, you can create a hook to the relevant event with create_flow_sla_failed_hook
or create_flow_run_state_changed_hook
You can also set parameters for the action to template fields from the event, e.g. {"foo": "foo-value", "failed_flow_run": "{flow_run_id}"}
and to validate that the action is working, you can click on the bug icon in the UI page here: https://cloud.prefect.io/team/actionsKevin Kho
04/27/2022, 5:43 PMAlex Cannon
04/27/2022, 5:45 PMAnna Geller
04/27/2022, 5:46 PMKevin Kho
04/27/2022, 5:49 PMZanie
04/27/2022, 5:52 PMinput webhook_action_config {
"The webhook url to send the payload to"
url: String!
"An optional JSON payload, defaults to the event data"
payload: JSON
"Optional headers to send with the request, defaults to passing the event id"
headers: JSON
}
create_action
mutation as provided by Anna but instead of a create_flow_run
action you want to use a webhook_action
there.Alex Cannon
04/27/2022, 6:41 PM