1.15.4.dev2+g3e3ce2426

flytekit.core.notification

Notifications are primarily used when defining Launch Plans (also can be used when launching executions) and will trigger the Flyte platform to send emails when a workflow run reaches certain stages (fails or succeeds, etc.).

.. note::

Notifications require some setup and configuration on the Flyte platform side. Please contact your Flyte platform
admins to get this feature enabled. See :std:ref:`cookbook:setting up workflow notifications`

Each notification type takes a list of :py:class:flytekit.models.core.execution.WorkflowExecutionPhase and a list of emails. Even though there are different notification classes in this module, they all just send email. The differentiation offers semantic meaning to the end-user but do not functionally behave differently. Successful integration with Slack and Pagerduty is incumbent on those email API being set-up correctly.

.. autoclass:: flytekit.core.notification.Notification

Directory

Classes

Class Description
Email This notification should be used when sending regular emails to people.
Notification None.
PagerDuty This notification should be used when sending emails to the PagerDuty service.
Slack This notification should be used when sending emails to the Slack.

flytekit.core.notification.Email

This notification should be used when sending regular emails to people.

.. code-block:: python

from flytekit.models.core.execution import WorkflowExecutionPhase

Email(phases=[WorkflowExecutionPhase.SUCCEEDED], recipients_email=[“[email protected]”])

def Email(
    phases: typing.List[int],
    recipients_email: typing.List[str],
):
Parameter Type
phases typing.List[int]
recipients_email typing.List[str]

Methods

Method Description
from_flyte_idl()
serialize_to_string() None
short_string()
to_flyte_idl()
verbose_string()

from_flyte_idl()

def from_flyte_idl(
    p,
):
Parameter Type
p

serialize_to_string()

def serialize_to_string()

short_string()

def short_string()

to_flyte_idl()

def to_flyte_idl()

verbose_string()

def verbose_string()

Properties

Property Type Description
email
is_empty
pager_duty
phases
slack

flytekit.core.notification.Notification

def Notification(
    phases: typing.List[int],
    email: flytekit.models.common.EmailNotification,
    pager_duty: flytekit.models.common.PagerDutyNotification,
    slack: flytekit.models.common.SlackNotification,
):
Parameter Type
phases typing.List[int]
email flytekit.models.common.EmailNotification
pager_duty flytekit.models.common.PagerDutyNotification
slack flytekit.models.common.SlackNotification

Methods

Method Description
from_flyte_idl()
serialize_to_string() None
short_string()
to_flyte_idl()
verbose_string()

from_flyte_idl()

def from_flyte_idl(
    p,
):
Parameter Type
p

serialize_to_string()

def serialize_to_string()

short_string()

def short_string()

to_flyte_idl()

def to_flyte_idl()

verbose_string()

def verbose_string()

Properties

Property Type Description
email
is_empty
pager_duty
phases
slack

flytekit.core.notification.PagerDuty

This notification should be used when sending emails to the PagerDuty service.

.. code-block:: python

from flytekit.models.core.execution import WorkflowExecutionPhase

PagerDuty(phases=[WorkflowExecutionPhase.SUCCEEDED], recipients_email=[“[email protected]”])

def PagerDuty(
    phases: typing.List[int],
    recipients_email: typing.List[str],
):
Parameter Type
phases typing.List[int]
recipients_email typing.List[str]

Methods

Method Description
from_flyte_idl()
serialize_to_string() None
short_string()
to_flyte_idl()
verbose_string()

from_flyte_idl()

def from_flyte_idl(
    p,
):
Parameter Type
p

serialize_to_string()

def serialize_to_string()

short_string()

def short_string()

to_flyte_idl()

def to_flyte_idl()

verbose_string()

def verbose_string()

Properties

Property Type Description
email
is_empty
pager_duty
phases
slack

flytekit.core.notification.Slack

This notification should be used when sending emails to the Slack.

.. code-block:: python

from flytekit.models.core.execution import WorkflowExecutionPhase

Slack(phases=[WorkflowExecutionPhase.SUCCEEDED], recipients_email=[“[email protected]”])

def Slack(
    phases: typing.List[int],
    recipients_email: typing.List[str],
):
Parameter Type
phases typing.List[int]
recipients_email typing.List[str]

Methods

Method Description
from_flyte_idl()
serialize_to_string() None
short_string()
to_flyte_idl()
verbose_string()

from_flyte_idl()

def from_flyte_idl(
    p,
):
Parameter Type
p

serialize_to_string()

def serialize_to_string()

short_string()

def short_string()

to_flyte_idl()

def to_flyte_idl()

verbose_string()

def verbose_string()

Properties

Property Type Description
email
is_empty
pager_duty
phases
slack