You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: Create webhook triggers for a Sim integration using the generic trigger builder
2
+
description: Create webhook or polling triggers for a Sim integration
3
3
argument-hint: <service-name>
4
4
---
5
5
6
6
# Add Trigger
7
7
8
-
You are an expert at creating webhook triggers for Sim. You understand the trigger system, the generic `buildTriggerSubBlocks` helper, and how triggers connect to blocks.
8
+
You are an expert at creating webhook and polling triggers for Sim. You understand the trigger system, the generic `buildTriggerSubBlocks` helper, polling infrastructure, and how triggers connect to blocks.
9
9
10
10
## Your Task
11
11
12
-
1. Research what webhook events the service supports
13
-
2. Create the trigger files using the generic builder
14
-
3. Create a provider handler if custom auth, formatting, or subscriptions are needed
12
+
1. Research what webhook events the service supports — if the service lacks reliable webhooks, use polling
13
+
2. Create the trigger files using the generic builder (webhook) or manual config (polling)
14
+
3. Create a provider handler (webhook) or polling handler (polling)
15
15
4. Register triggers and connect them to the block
**Versioned blocks (V1 + V2):** Many integrations have a hidden V1 block and a visible V2 block. Where you add the trigger wiring depends on how V2 inherits from V1:
173
+
174
+
-**V2 uses `...V1Block` spread** (e.g., Google Calendar): Add trigger to V1 — V2 inherits both `subBlocks` and `triggers` automatically.
175
+
-**V2 defines its own `subBlocks`** (e.g., Google Sheets): Add trigger to V2 (the visible block). V1 is hidden and doesn't need it.
176
+
-**Single block, no V2** (e.g., Google Drive): Add trigger directly.
177
+
178
+
`generate-docs.ts` deduplicates by base type (first match wins). If V1 is processed first without triggers, the V2 triggers won't appear in `integrations.json`. Always verify by checking the output after running the script.
179
+
166
180
## Provider Handler
167
181
168
182
All provider-specific webhook logic lives in a single handler file: `apps/sim/lib/webhooks/providers/{service}.ts`.
@@ -327,6 +341,122 @@ export function buildOutputs(): Record<string, TriggerOutput> {
327
341
}
328
342
```
329
343
344
+
## Polling Triggers
345
+
346
+
Use polling when the service lacks reliable webhooks (e.g., Google Sheets, Google Drive, Google Calendar, Gmail, RSS, IMAP). Polling triggers do NOT use `buildTriggerSubBlocks` — they define subBlocks manually.
0 commit comments