Webhook to Slack: Throttled Duplicate-Suppressing Alert Template
A Webhook trigger checks MongoDB for a recent identical alert before posting to Slack, so repeated events do not spam your channel within a time window.
What It Builds
This Spojit template starts with a Webhook trigger that receives an incoming event, builds a stable fingerprint for the alert, and uses a Connector node on the mongodb connector to check whether the same alert already fired inside a recent time window. If it did, the workflow stops quietly. If it did not, a Connector node on the slack connector posts the alert with send-message, and the fingerprint is recorded in MongoDB so the next identical event is suppressed.
The Prompt
Paste this into Miraxa, the intelligent layer across your automation, and it builds the workflow, connecting the tools for you:
Build a workflow with a Webhook trigger that receives an alert event. Create a fingerprint from the alert's key fields. Use the mongodb connector to look for a document in the "alerts" collection with that same fingerprint inserted in the last 15 minutes. If a recent match exists, stop the workflow. If not, post a message to the #alerts Slack channel with the alert details, then insert a document into the mongodb "alerts" collection recording the fingerprint and the current time.
Connectors Used
- Webhook trigger - external systems POST the alert event to the workflow's URL; verify the sender with a signing connection.
- mongodb -
find-documentschecks for a recent identical alert andinsert-documentsrecords each one that is sent. - slack -
send-messageposts the alert to your channel when it is not a duplicate.
Customize It
Change the suppression window (the 15 minutes) to match how chatty your source is, swap #alerts for your own channel, and adjust which fields form the fingerprint. A fingerprint built from fewer fields suppresses more aggressively; one built from more fields treats smaller differences as new alerts. You can also add a Condition node so only high-severity events post while lower ones are recorded silently.
Tips
- Use a Direct mode Connector node for both MongoDB calls and the Slack post: the steps are predictable single-tool calls, so Direct mode keeps them deterministic and free of AI cost.
- Build the fingerprint from fields that stay constant for "the same alert" (for example a host name plus an error code), not from timestamps or request IDs that change every time.
- Add a TTL index on your MongoDB
alertscollection so old fingerprint documents expire on their own and the lookup stays fast.
Common Pitfalls
- If the
find-documentstime filter is missing, every event past the first looks like a duplicate forever and nothing posts. Always scope the lookup to a recent window. - The Webhook trigger returns
202and runs asynchronously, so a suppressed alert is not an error: check the execution history to confirm the dedup branch ran as expected. - Make sure the workflow inserts the fingerprint document only after the Slack post succeeds, or a failed post can still mark the alert as "sent" and hide the next one.
Related
- How to Build a Webhook-Triggered Order Processing Workflow for the step-by-step on receiving and acting on webhook events.
- How to Send Slack Alerts for New E-commerce Orders for a sibling alerting pattern.
- Setting Up a Webhook Trigger to configure and secure the trigger.