Learn how to build an automated workflow using n8n to monitor running tests for specific health metrics and receive instant alerts in Slack.
Overview:
This guide walks you through creating a daily automation that checks running tests for traffic or data issues (low visitors, SRM failures, large conversion drops, minimum orders per variant) and posts a Slack alert when a test fails health thresholds.
Softwares Used
To build this automated reporting pipeline, you will need the following tools:
n8n: The primary workflow automation platform used to connect APIs and schedule tasks.
Slack: The final destination where the AI-generated health checks and reports will be posted.
Update the below code so that InsertOrgId maps to match the Intelligems organization IDs of your clients (you can find these in Intelligems under Settings > General > Organization Settings), the name value is display name for your clients, and the apiKey value is the Intelligems API Key for those clients. Then paste this code into the Code section in n8n.
Update the below code so that the minTotalVisitors, minOrdersPerVariant, srmPValueThreshold, and conversionDropThreshold values match your threshold requirements. Then paste this code into the Code section in n8n.
Node 7: If hasIssues = True
Addan "If" node
Set the condition as {{ $json.hasIssues }} is euqal to true
Node 8: Send to Slack
For the "true" response only, add a "Slack" node where the action is "Send a message"
Authentication:
Click "Create New Credential"
Click "Connect my account" and follow the prompts
Channel/Use:
Under "Send Message To" configure where you want this slack message to appear
Message:
in "Message Text" input:
Step 3: Activate the Workflow
Once everything works, click "publish" at the top to make this workflow go live!
Your workflow will now run 3 times a day and notify you if an active test does not meet your threshold.