Send Slack notifications
dltHub supports native Slack notifications for pipeline status changes, configured directly in the Web UI using Slack incoming webhooks. You can also send custom Slack messages programmatically from within your pipeline code.
dltHub platform alerts
Configuring Slack alerts in the dltHub Web UI is the preferred way to monitor pipeline runs. It requires no code changes or secrets in your repository, catches container and runtime failures that happen before user code executes, formats messages with interactive Slack Block Kit buttons, and allows routing alerts to different channels across your team.
With platform alerts, dltHub dispatches rich notifications to your Slack channels whenever a pipeline run fails or succeeds.

Step 1: Create an incoming webhook in Slack
- Open the Slack Incoming Webhooks guide.
- Create a Slack app (or select an existing one in your workspace).
- Enable Incoming Webhooks and click Add New Webhook to Workspace.
- Select the destination Slack channel (e.g.
#data-alertsor#pipeline-monitoring) and authorize the webhook. - Copy the generated Webhook URL (
https://hooks.slack.com/services/T.../B.../...).
Step 2: Connect the Slack channel in dltHub
- Open the dltHub Web UI and navigate to your workspace.
- In the left navigation, go to Settings > Alerts (
/w/<workspace_id>/settings/alerts). - In the Slack Channel Setup card, click + Add channel.
- Enter a friendly Channel name (e.g.
#data-alerts). - Paste the Webhook URL copied from Slack.
- Click Save in the bottom changes bar to store the channel.
Step 3: Route alerts to your Slack channels and test
- In the Alerts Configuration section on the same page, locate the trigger:
- Job run failures: Fires whenever a pipeline or job run fails.
- Job run successes: Fires whenever a pipeline or job run finishes successfully.
-
Toggle the alert switch On.
-
Click the Slack Channels dropdown to open the Post to popover:
- Check the channel(s) that should receive this alert. You can select multiple channels.
- Click the Test button next to any channel to dispatch a test notification immediately and verify delivery for that alert type.
- Under Scope, choose which jobs to monitor:
- All jobs: Delivers alerts for any job run in the workspace.
- Specific pipelines: Filters alerts to a selected list of pipelines.
-
(Optional) Under Email Recipients, select ( ) No email recipients if you want alerts routed exclusively to Slack.
-
Click Save in the bottom changes bar.
What the Slack notification includes
dltHub formats alerts using Slack Block Kit:
- Status header: Indicates the pipeline name, environment, and outcome (e.g.
dltHub • Job Run Failed: my_pipeline (prod)). - Color-coded attachment: Red for failures, green for completions.
- Run metadata: Workspace name, exact reported timestamp, and trigger source.
- Failure reason: Truncated error message and stack excerpt (for failure alerts).
- Interactive action buttons:
- View Run Details: Deep links directly to the run page and execution logs in dltHub.
- View Pipeline: Links to the pipeline overview page.
Custom Slack notifications from code (in-code alternative)
dltHub platform alerts above manage channel webhooks and pipeline run notifications across your workspace with zero code changes.
Use the in-code pattern below only if you need custom notification logic from within Python (for instance, notifying Slack on dlt schema changes or custom load metrics).
dlt ships a helper, send_slack_message, that posts to a Slack incoming webhook. Combined with pipeline.runtime_config.slack_incoming_hook, it gives you a way to alert a channel directly from your Python script.
Store the webhook in your prod profile
Add to .dlt/prod.secrets.toml:
[runtime]
slack_incoming_hook = "https://hooks.slack.com/services/T…/B…/…"
dlt picks this up automatically and exposes it at runtime as pipeline.runtime_config.slack_incoming_hook. To also get notifications from local runs, mirror the same [runtime] block into .dlt/dev.secrets.toml.
Wire it into your pipeline
import time
from datetime import datetime, timezone
import dlt
from dlt.common.runtime.slack import send_slack_message
from dlt.hub import run
@run.pipeline("my_pipeline")
def my_job():
pipeline = dlt.pipeline(
pipeline_name="my_pipeline",
destination="warehouse",
dataset_name="my_dataset",
)
hook = pipeline.runtime_config.slack_incoming_hook
started = time.time()
try:
load_info = pipeline.run(my_source())
if hook:
send_slack_message(
hook,
"\n".join([
f":white_check_mark: *`{pipeline.pipeline_name}` succeeded*",
f"*Finished:* {datetime.now(timezone.utc):%Y-%m-%d %H:%M:%S UTC}",
f"*Duration:* {time.time() - started:.1f}s",
f"*Load ID:* `{load_info.loads_ids[-1]}`",
]),
)
except Exception as e:
if hook:
send_slack_message(
hook,
f":x: *`{pipeline.pipeline_name}` failed*: `{type(e).__name__}: {e}`",
)
raise
The if hook: check skips the Slack call when no webhook is configured. The same script works in any profile, whether you've set up notifications or not.
You can also notify Slack whenever a load surfaces new tables or columns. The dlt chess pipeline shows this pattern by inspecting schema_update on each load package and posting a message when new tables or columns appear.
Deploy and trigger
uv run dlthub deploy # syncs code + prod secret
uv run dlthub run my_job # triggers the job, posts to Slack on completion