Guides / Automation
Automation · about 10 min
Send a Slack alert when a rule fires
Answer the questions, test a rule on the answers, and post to a Slack channel only when it is true.
- A Slack workspace where you can add an app.
- Admin role in your organization here (to add a connection).
Create a Slack incoming webhook
In Slack: api.slack.com/apps → Create New App → From scratch, pick your workspace, then Incoming Webhooks → turn it on → Add New Webhook to Workspace → choose the channel. Copy the URL (it starts with
https://hooks.slack.com/services/).Add it as a connection
Go to Settings → Connections, pick Slack, name it
trading-desk, paste the URL and press Add connection. Press Send test and check the channel. The URL is stored encrypted and never shown again; requests only use the name.Add an action to the request
An action has an
id, a rule (when), what to do (do), the connection's name and a message.{{drop5|pct}}fills in the answer as a percentage.{ "model": "ora1", "state": { "symbol": "TSLA" }, "questions": { "up_week": { "type": "yes_no", "instructions": "Will the stock be higher in a week?" }, "drop5": { "type": "yes_no", "instructions": "Will it drop at least 5% at some point in the next month?" } }, "actions": [ { "id": "desk_alert", "when": "drop5 >= 0.6", "do": "slack", "connection": "trading-desk", "message": "{{symbol}} ({{as_of}}): {{drop5|pct}} chance of a 5% drawdown within a month. Consider sizing down." } ], "dry_run": true }Open this in the PlaygroundDry run first
With Dry run ticked, the response shows each action as would send (dry run) or rule false: skipped, with the exact message, and nothing is posted. Lower the threshold (for example
drop5 >= 0.1) to see it fire.Send it for real
Untick Dry run and run again. The action shows queued to send; follow it under Actions (delivered, retrying or failed). From code, send the same body with
"dry_run": false.Run it on a schedule
To check a whole watchlist every day, put the same questions and action in a workflow: Run a watchlist every day.