Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
2e89fe5
fix(triggers): apply webhook audit follow-ups
waleedlatif1 Apr 6, 2026
bb716bb
fix(webhooks): Salesforce provider handler, Zoom CRC and block wiring
waleedlatif1 Apr 6, 2026
0ddc769
fix(webhooks): harden Resend and Linear triggers (idempotency, auth, …
waleedlatif1 Apr 6, 2026
e9618d9
fix(webhooks): harden Vercel and Greenhouse trigger handlers
waleedlatif1 Apr 6, 2026
317d4ab
fix(gong): JWT verification, trigger UX, alignment script
waleedlatif1 Apr 6, 2026
729667a
fix(notion): align webhook lifecycle and outputs
waleedlatif1 Apr 6, 2026
e79c556
fix(webhooks): tighten remaining provider hardening
waleedlatif1 Apr 7, 2026
23ccc9b
refactor(webhooks): move subscription helpers out of providers
waleedlatif1 Apr 7, 2026
e000c5b
fix(zoom): resolve env-backed secrets during validation
waleedlatif1 Apr 7, 2026
b50a902
fix build
waleedlatif1 Apr 7, 2026
732755a
consolidate tests
waleedlatif1 Apr 7, 2026
7c31044
refactor(salesforce): share payload object type parsing
waleedlatif1 Apr 7, 2026
41b0348
fix(webhooks): address remaining review follow-ups
waleedlatif1 Apr 7, 2026
cae9c8b
test(webhooks): separate Zoom coverage and clean Notion output shape
waleedlatif1 Apr 7, 2026
a305fc2
feat(triggers): enrich Vercel and Greenhouse webhook output shapes
waleedlatif1 Apr 7, 2026
3e29341
feat(webhooks): enrich Resend trigger outputs; clarify Notion output …
waleedlatif1 Apr 7, 2026
5148936
feat(webhooks): enrich Zoom and Gong trigger output schemas
waleedlatif1 Apr 7, 2026
0600c90
feat(triggers): enrich Salesforce and Linear webhook output schemas
waleedlatif1 Apr 7, 2026
1cd27d8
remove from mdx
waleedlatif1 Apr 7, 2026
e0580f7
chore(webhooks): expand trigger alignment coverage
waleedlatif1 Apr 7, 2026
3e7a046
updated skills
waleedlatif1 Apr 7, 2026
d3fcf04
updated file naming semantics
waleedlatif1 Apr 7, 2026
2897ce1
rename file
waleedlatif1 Apr 7, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
updated file naming semantics
  • Loading branch information
waleedlatif1 committed Apr 7, 2026
commit d3fcf04958a02f04a5356a426dc2a7281df007d1
15 changes: 8 additions & 7 deletions .agents/skills/add-trigger/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@ apps/sim/triggers/{service}/
├── {event_b}.ts # Secondary trigger (no dropdown)
└── webhook.ts # Generic webhook trigger (optional, for "all events")

apps/sim/lib/webhooks/providers/
├── {service}.ts # Provider handler (auth, formatInput, matchEvent, subscriptions)
├── types.ts # WebhookProviderHandler interface
├── utils.ts # Shared helpers (createHmacVerifier, verifyTokenAuth, skipByEventTypes)
├── subscription-utils.ts # Shared subscription helpers (getProviderConfig, getNotificationUrl)
└── registry.ts # Handler map + default handler
apps/sim/lib/webhooks/
├── provider-subscription-utils.ts # Shared subscription helpers (getProviderConfig, getNotificationUrl)
├── providers/
│ ├── {service}.ts # Provider handler (auth, formatInput, matchEvent, subscriptions)
│ ├── types.ts # WebhookProviderHandler interface
│ ├── utils.ts # Shared helpers (createHmacVerifier, verifyTokenAuth, skipByEventTypes)
│ └── registry.ts # Handler map + default handler
```

## Step 1: Create `utils.ts`
Expand Down Expand Up @@ -267,7 +268,7 @@ If they differ: the tag dropdown shows fields that don't exist, or actual data h
If the service API supports programmatic webhook creation, implement `createSubscription` and `deleteSubscription` on the handler. The orchestration layer calls these automatically — **no code touches `route.ts`, `provider-subscriptions.ts`, or `deploy.ts`**.

```typescript
import { getNotificationUrl, getProviderConfig } from '@/lib/webhooks/providers/subscription-utils'
import { getNotificationUrl, getProviderConfig } from '@/lib/webhooks/provider-subscription-utils'
import type { DeleteSubscriptionContext, SubscriptionContext, SubscriptionResult } from '@/lib/webhooks/providers/types'

export const {service}Handler: WebhookProviderHandler = {
Expand Down
2 changes: 1 addition & 1 deletion .agents/skills/validate-trigger/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Also read for reference:
```
apps/sim/lib/webhooks/providers/types.ts # WebhookProviderHandler interface
apps/sim/lib/webhooks/providers/utils.ts # Shared helpers (createHmacVerifier, etc.)
apps/sim/lib/webhooks/providers/subscription-utils.ts # Subscription helpers
apps/sim/lib/webhooks/provider-subscription-utils.ts # Subscription helpers
apps/sim/lib/webhooks/processor.ts # Central webhook processor
```

Expand Down
15 changes: 8 additions & 7 deletions .claude/commands/add-trigger.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@ apps/sim/triggers/{service}/
├── {event_b}.ts # Secondary trigger (no dropdown)
└── webhook.ts # Generic webhook trigger (optional, for "all events")

apps/sim/lib/webhooks/providers/
├── {service}.ts # Provider handler (auth, formatInput, matchEvent, subscriptions)
├── types.ts # WebhookProviderHandler interface
├── utils.ts # Shared helpers (createHmacVerifier, verifyTokenAuth, skipByEventTypes)
├── subscription-utils.ts # Shared subscription helpers (getProviderConfig, getNotificationUrl)
└── registry.ts # Handler map + default handler
apps/sim/lib/webhooks/
├── provider-subscription-utils.ts # Shared subscription helpers (getProviderConfig, getNotificationUrl)
├── providers/
│ ├── {service}.ts # Provider handler (auth, formatInput, matchEvent, subscriptions)
│ ├── types.ts # WebhookProviderHandler interface
│ ├── utils.ts # Shared helpers (createHmacVerifier, verifyTokenAuth, skipByEventTypes)
│ └── registry.ts # Handler map + default handler
```

## Step 1: Create `utils.ts`
Expand Down Expand Up @@ -267,7 +268,7 @@ If they differ: the tag dropdown shows fields that don't exist, or actual data h
If the service API supports programmatic webhook creation, implement `createSubscription` and `deleteSubscription` on the handler. The orchestration layer calls these automatically — **no code touches `route.ts`, `provider-subscriptions.ts`, or `deploy.ts`**.

```typescript
import { getNotificationUrl, getProviderConfig } from '@/lib/webhooks/providers/subscription-utils'
import { getNotificationUrl, getProviderConfig } from '@/lib/webhooks/provider-subscription-utils'
import type { DeleteSubscriptionContext, SubscriptionContext, SubscriptionResult } from '@/lib/webhooks/providers/types'

export const {service}Handler: WebhookProviderHandler = {
Expand Down
2 changes: 1 addition & 1 deletion .claude/commands/validate-trigger.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Also read for reference:
```
apps/sim/lib/webhooks/providers/types.ts # WebhookProviderHandler interface
apps/sim/lib/webhooks/providers/utils.ts # Shared helpers (createHmacVerifier, etc.)
apps/sim/lib/webhooks/providers/subscription-utils.ts # Subscription helpers
apps/sim/lib/webhooks/provider-subscription-utils.ts # Subscription helpers
apps/sim/lib/webhooks/processor.ts # Central webhook processor
```

Expand Down
32 changes: 31 additions & 1 deletion apps/sim/lib/webhooks/providers/salesforce.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,37 @@ import type {
WebhookProviderHandler,
} from '@/lib/webhooks/providers/types'
import { verifyTokenAuth } from '@/lib/webhooks/providers/utils'
import { extractSalesforceObjectTypeFromPayload } from '@/lib/webhooks/salesforce-payload-utils'

export function extractSalesforceObjectTypeFromPayload(
body: Record<string, unknown>
): string | undefined {
const direct =
(typeof body.objectType === 'string' && body.objectType) ||
(typeof body.sobjectType === 'string' && body.sobjectType) ||
undefined
if (direct) {
return direct
}

const attrs = body.attributes as Record<string, unknown> | undefined
if (typeof attrs?.type === 'string') {
return attrs.type
}

const record = body.record
if (record && typeof record === 'object' && !Array.isArray(record)) {
const r = record as Record<string, unknown>
if (typeof r.sobjectType === 'string') {
return r.sobjectType
}
const ra = r.attributes as Record<string, unknown> | undefined
if (typeof ra?.type === 'string') {
return ra.type
}
}

return undefined
}
Comment thread
waleedlatif1 marked this conversation as resolved.

const logger = createLogger('WebhookProvider:Salesforce')

Expand Down
4 changes: 2 additions & 2 deletions apps/sim/lib/webhooks/providers/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@ export interface WebhookProviderHandler {
/** Custom error response when queuing fails. Return null for default 500. */
formatQueueErrorResponse?(): NextResponse | null

/** Custom input preparation. Replaces the standard `formatWebhookInput` call when defined. */
/** Custom input preparation. When defined, replaces the default pass-through of the raw body. */
formatInput?(ctx: FormatInputContext): Promise<FormatInputResult>

/** Called when standard `formatWebhookInput` returns null. Return skip message or null to proceed. */
/** Called when input is null after formatting. Return skip message or null to proceed. */
handleEmptyInput?(requestId: string): { message: string } | null

/** Post-process input to handle file uploads before execution. */
Expand Down
30 changes: 0 additions & 30 deletions apps/sim/lib/webhooks/salesforce-payload-utils.ts

This file was deleted.

2 changes: 1 addition & 1 deletion apps/sim/triggers/salesforce/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { extractSalesforceObjectTypeFromPayload } from '@/lib/webhooks/salesforce-payload-utils'
import { extractSalesforceObjectTypeFromPayload } from '@/lib/webhooks/providers/salesforce'
import type { SubBlockConfig } from '@/blocks/types'
import type { TriggerOutput } from '@/triggers/types'

Expand Down
Loading