from truefoundry.deploy import Workflow, WorkflowAlert, SlackWebhook, Email
wf = Workflow(
name="test-email-alerts-2",
workflow_file_path="nested.py",
alerts=[
WorkflowAlert(
notification_target=SlackWebhook(
notification_channel="<Paste your slack webhook notification integration fqn here>",
),
on_completion=True,
on_failure=True,
),
WorkflowAlert(
notification_target=Email(
notification_channel="<Paste your email notification integration fqn here>",
to_emails=["demo@truefoundry.com"],
),
on_completion=True,
on_failure=True,
),
WorkflowAlert(
notification_target=SlackBot(
notification_channel="<Paste your slack bot notification integration fqn here>",
channels=["#workflow-notifications"],
),
on_completion=True,
on_failure=True,
),
],
)
wf.deploy("<workspace-fqn>", wait=False)