Docs / Actions & workflows
Actions
A request can say what to do with its answers. Add an actions list: each action has a rule on the answers (when), what to do (slack, webhook or email, see Destinations) and the name of a connection. We answer the questions, run the rules, and deliver every action that fires.
state + questions→answers→
drop5 >= 0.6→Slacktrading-desk{
"model": "ora1",
"state": {
"symbol": "TSLA",
"context": {
"return_5d": 0.08,
"volatility_20d": 0.55,
"rsi_14": 71
}
},
"questions": {
"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}}: {{drop5|pct}} chance of a 5% drop this month"
},
{
"id": "hedge",
"when": "drop5 >= 0.75",
"do": "webhook",
"connection": "my-oms",
"body": {
"symbol": "{{symbol}}",
"action": "buy_put",
"p": "{{drop5}}"
}
},
{
"id": "all_clear",
"when": "else",
"do": "email",
"connection": "me",
"subject": "{{symbol}}: no alert"
}
],
"dry_run": true
}
The response adds what happened to each action:
{
"actions": [
{
"id": "desk_alert",
"fired": true,
"status": "queued",
"run_id": "act_9f2c…"
},
{
"id": "hedge",
"fired": false,
"status": "skipped"
},
{
"id": "all_clear",
"fired": false,
"status": "skipped"
}
]
}
queued | Fired and queued for delivery. Follow it in Actions. |
|---|---|
skipped | The rule was false. |
dry_run | Fired, nothing sent. preview holds the exact message or body. Set "dry_run": true on the request; the Playground starts with it on. |
rejected | Fired but not queued: unknown or disabled connection, or the organization's limit (60/minute, 2,000/day). See error. |
Delivery is asynchronous and retried 3 times (after 30 s, 2 min, 10 min) on network errors, 429 and 5xx. At most 10 actions per request. Requests never carry URLs, tokens or addresses: only connection names.
Create an account Open the Playground
Everything here also lives in the console, next to your keys and usage.