Post model monitoring emails to data science channel
When a model monitoring alert email arrives, its subject and a short snippet are posted to your data science Slack channel with a link to the original, so the team sees it right away.
Install it
Set up this Zap for me, read how here: https://zapier.sh/zapier/awesome-zaps/post-model-monitoring-emails-to-data-science-channel/
Paste into Claude, ChatGPT, Cursor or any agent.
- Category
- Engineering · Ml ops AI operations
- Author
- Zapier
- Source
- zapier/awesome-zaps, folder zaps/post-model-monitoring-emails-to-data-science-channel
Set it up with the CLI
- Add it. Copies the folder into
zaps/post-model-monitoring-emails-to-data-science-channel/. Outside a project, it makes one first.npx zap-pack add awesome-zaps/post-model-monitoring-emails-to-data-science-channel - Fill in the values in
config.ts, and in any other file the list marks. Replace each one as its comment and SKILL.md say. - Deploy it. Asks for any value still left, signs you in to Zapier if you aren't, then publishes it to your account.
npx zap-pack deploy post-model-monitoring-emails-to-data-science-channel - Check it. Its recent runs, with status and errors.
npx zap-pack logs post-model-monitoring-emails-to-data-science-channel
zaps/post-model-monitoring-emails-to-data-science-channel/
- README.mdWhat it does, for people
- SKILL.mdHow an agent sets it up: what to ask you, and how to test it
- config.tsIts settings 1 to fill in
- connections/gmail.tsThe
gmailaccount it uses - connections/slack.tsThe
slackaccount it uses - triggers/message.tsWhat starts it:
gmailmessage - workflow.tsThe code; each
ctx.stepis a step in the Zap
Agents: add --yes to any command so it never prompts. When it needs an answer only the user can give, it stops and names the flag that supplies it.
SKILL.md
View MarkdownWhat it does
- Trigger: a new email arrives in the Gmail Inbox (
gmail,message). - Filter: if neither the subject nor the body contains one of the alert keywords (
alert,monitoring,drift,threshold, case-insensitive), the run stops and posts nothing. - Format: the subject becomes the heading
Model monitoring alert: <subject>. The body is flattened to one line and trimmed to 400 characters. A link to the original email is added when Gmail provides one. - Slack posts that text as one message to the configured channel. No one is mentioned unless
MENTION_PREFIXis set.
Ask the user
Each REPLACE_… value is set per person. Resolve channel names to IDs with the user's Slack connection; don't ask them to paste an ID you can look up.
| Setting | What goes there |
|---|---|
SLACK_CHANNEL |
The Slack channel that receives the alert posts, as its ID (C…) |
Also review the defaults with them:
ALERT_KEYWORDS(inworkflow.ts): words that mark an email as an alert. The defaults are a guess; match them to your monitoring tool's email wording.MENTION_PREFIX: empty, so no one is pinged. Set it to"<!channel> "to ping the channel for each alert.ALERT_HEADER: the text before each subject. DefaultModel monitoring alert.BODY_SNIPPET_LENGTH(inworkflow.ts): how many characters of the body to post. Default 400.
Prerequisite question: which Gmail mailbox receives the monitoring alerts? The trigger reads that account's Inbox.
Build it
If you can run shell commands, set it up with zap-pack: run npx zap-pack add awesome-zaps/post-model-monitoring-emails-to-data-science-channel, replace each REPLACE_… value as this file says, then run npx zap-pack deploy post-model-monitoring-emails-to-data-science-channel, which signs the user in to Zapier when it gets there. Otherwise build with Zapier MCP, as the steps below say. No Zapier MCP tools? Read https://docs.zapier.com/mcp/get-started/quickstart.md and follow the page for the app you are running in to get the user connected, then continue with this build.
- Accounts: bind
slackto the user's Slack connection for the workspace with the data science channel, andgmail(the trigger's account) to the Gmail connection for the mailbox that receives the alerts. No other app needs a connection. - Source: publish
workflow.tsandconfig.ts, with eachREPLACE_…replaced by the user's answer.triggers/message.tsandconnections/are settings, not code: set the workflow's trigger and connection bindings from them. The trigger file names the app by its slug; for the trigger'sselected_api, callsearch_triggerswith that slug, find the row whosekeyis the trigger'sevent, and use<app_key>@<app_version>from it. - Build guide: load Zapier's build guide with
get_zapier_skill("zapier:build-workflows")and follow it to create, test and publish the workflow. - Fields: inspect each action's fields with the user's connections (and sample the trigger, if it has one) before the first test run, and fix any key in
workflow.tsthat doesn't match.
Test it
Run it once as a draft test, with the Slack channel set to one the user controls:
{
"subject": "[install-test] Model drift alert: churn-model threshold breached",
"body_plain": "[install-test] Synthetic monitoring email. Feature drift score 0.42 exceeded threshold 0.30 on churn-model v3. This is a test message from the install check; no action needed.",
"message_id": "install-test-msg-001",
"message_url": "https://mail.google.com/mail/u/0/#inbox/install-test-msg-001"
}
Check that one message appears in the channel, with the bold heading Model monitoring alert: [install-test] …, the body snippet, and the link line. Then check that an email with no alert keyword in its subject or body (for example, a newsletter) returns skipped: true with no Slack post. If run-status tools aren't available, check the result in Slack directly. Then publish, confirm the trigger is active, and ask the user to delete the test message; the agent doesn't delete it.
Notes
- Each new email posts once per trigger delivery. The Zap doesn't look up earlier Slack posts, so a duplicate delivery could post twice.
- The link line uses Gmail's own message URL, which opens only for the mailbox owner.
- Keep
link_namesandadd_edit_linkoff in the Slack step, as written. Otherwise Slack may ping people or add an automation link to each alert. - To extend it: DM the on-call owner based on tags in the subject, or open an incident ticket in your tracking tool, as a step after the Slack post.