Skip to main content
Automations let you build workflows that trigger when specific Polymarket events happen — like whale trades, probability spikes, or new markets — and deliver results to Discord, Telegram, a webhook, or your Struct chat. Each automation connects a webhook event to either an AI agent that analyzes the data or a template that formats it, then routes the output to a destination of your choice.

Creating an Automation

1

Open Automations

Navigate to Automations in your dashboard sidebar.
2

Choose a starting point

Click New Automation. You can start from a pre-built template or build from scratch.
3

Select a trigger event

Pick the webhook event that will fire your automation (e.g. trader_whale_trade, probability_spike). See Available Events for the full list.
4

Configure processing

Choose between AI mode (an AI agent analyzes the event data) or Direct mode (a Handlebars template formats the data). See Processing Modes below.
5

Set your output destination

Choose where results are delivered: Chat, Discord, Telegram, or a custom webhook. See Output Destinations below.
6

Enable and save

Set a rate limit, toggle the automation on, and save. A webhook subscription is automatically created for you.

Processing Modes

Every automation uses one of two processing modes to handle incoming event data.

AI Mode

The event data is sent to an AI agent along with your system prompt and user prompt template. The agent can analyze the data, use Struct API tools to look up additional context, and produce a natural-language response.
  • Uses an AI model with access to Struct API tools
  • Supports up to 20 tool-call steps per run
  • Best for analysis, recommendations, and investigations
System prompt:
"You are a prediction market analyst. Assess new markets for trading opportunities."

User prompt template:
"A new market was just created. Analyze it: {{event}}"

Direct Mode

The event data is interpolated into your Handlebars template with zero AI processing. The rendered template output is your result.
  • No AI calls — instant delivery
  • Uses Handlebars template syntax with custom formatters
  • Best for structured alerts, data forwarding, and notifications
Whale Trade Detected
Market: {{event.market_name}}
Side: {{uppercase event.side}}
Size: {{formatCurrency event.size_usd}}

Output Destinations

Each automation delivers its result to one of four destinations.

Chat

Results are saved as conversations in your Struct dashboard. AI-mode runs store both the prompt and response as a chat history you can review later.

Discord

Send results to a Discord channel via webhook. You can configure rich embeds with:
  • Custom title, color, and footer text
  • Thumbnail and image URLs
  • Structured fields (inline or full-width)
  • Optional message content outside the embed
All text fields support Handlebars template syntax, so embed values can be dynamically populated from event data.
Discord embeds have a 4,096-character limit for the description field. Longer outputs are automatically truncated.

Telegram

Send results to a Telegram chat via bot. Configuration options include:
  • Bot token and chat ID
  • Photo/caption mode for image-based alerts
  • Inline keyboard buttons with dynamic URLs
  • Link preview and notification toggles
Telegram captions are limited to 1,024 characters. Standard messages support up to 4,096 characters.

Webhook

POST results to any HTTP endpoint. The system auto-detects Discord webhook URLs and formats the payload as a Discord embed. For all other URLs, the payload is:
{
  "automationId": "uuid",
  "automationName": "My Automation",
  "result": "The formatted or AI-generated output",
  "eventPayload": { ... },
  "timestamp": "2026-03-11T12:00:00.000Z"
}

Filters

Automations inherit the same filtering capabilities as webhooks. You can narrow which events trigger your automation using:
  • Wallet address — track specific traders
  • Market / condition ID — target specific markets
  • Event slug — filter by event
  • USD thresholds — minimum/maximum value bounds
  • Probability range — 0.0 to 1.0
Only events matching all configured filters will trigger the automation.

Rate Limiting

Each automation has a configurable max runs per hour (default: 10). When the limit is reached, incoming events are logged with a rate_limited status and skipped until the window resets. Adjust the rate limit when creating or editing an automation to balance between coverage and cost.

Monitoring Runs

Every automation execution is logged as a run with the following details:
FieldDescription
Statuspending, running, completed, failed, or rate_limited
ResultThe AI-generated or template-rendered output text
Event payloadThe raw webhook event that triggered the run
DurationExecution time in milliseconds
Token usageInput and output tokens consumed (AI mode only)
View run history from the automation detail page in your dashboard. Failed runs include an error message for debugging.

Managing Automations

From the Automations page you can:
  • Enable / disable an automation without deleting it
  • Edit the trigger event, prompts, output config, or rate limit
  • Delete an automation and its associated webhook subscription
  • View logs to see the full chat history for AI-mode runs
Last modified on March 11, 2026