lp = LaunchPlan.get_or_create(
notifications=[
Webhook(
name=<webhook_name>, # Should match the name in Flyte admin config map.
phases=[
WorkflowExecutionPhase.SUCCEEDED,
],
payload=["{{ name succeeded }}"],
),
],
)
What you wrote in the PR suggests that in the admin config map the platform team maintains a mapping from webhook name to webhook urls and the users choose one of the webhook names in the launch plan. This sounds very good to me.
In the future I’d also be very interested in being able to include a custom message in the notification (e.g. to tag responsible people on workflow failure but other people on workflow success) but this is not for this PR I guess:
lp = LaunchPlan.get_or_create(
notifications=[
Webhook(
name=<webhook_name>, # Should match the name in Flyte admin config map.
message="... some custom string ...", # <-----
phases=[
WorkflowExecutionPhase.SUCCEEDED,
],
payload=["{{ name succeeded }}"],
),
],
)
Edit: Or is payload exactly that? 🤔