feat(webhooks): dedup and custom ack configuration#3525
feat(webhooks): dedup and custom ack configuration#3525icecrasher321 merged 3 commits intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Generic webhooks also gain custom acknowledgement responses (status code + optional JSON/text body) returned directly from the webhook endpoint when Separately, trigger execution reuses any existing cached output (even empty), and workflow comparison/normalization now ignores subBlock Written by Cursor Bugbot for commit 781cc28. Configure here. |
Greptile SummaryThis PR adds two features to the generic webhook trigger: payload-based deduplication (via a configurable dot-notation field path that maps to an idempotency key) and custom acknowledgement responses (allowing users to specify a status code and body to return to the webhook caller synchronously). The changes span the webhook processor, idempotency service, trigger config, and executor handler. Key changes and concerns:
Confidence Score: 2/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Caller as Webhook Caller
participant Processor as processor.ts
participant IdempSvc as IdempotencyService
participant Queue as Job Queue
participant TriggerHandler as TriggerBlockHandler
Caller->>Processor: POST /api/webhooks/trigger/:path
Processor->>Processor: Parse headers & body
alt provider === 'generic' && idempotencyField set
Processor->>Processor: Extract value via dot-notation path from body
Processor->>Processor: Set headers['x-sim-idempotency-key'] = extracted value
end
Processor->>IdempSvc: createWebhookIdempotencyKey(webhookId, headers, body, provider)
IdempSvc->>IdempSvc: Check x-sim-idempotency-key (NEW, highest priority)
IdempSvc->>IdempSvc: Fallback to webhook-id, x-webhook-id, etc.
IdempSvc-->>Processor: idempotency key
Processor->>IdempSvc: claim(key, ttl=7days)
alt duplicate within 7 days
IdempSvc-->>Processor: already processed
Processor-->>Caller: 200 (skipped)
else new event
Processor->>Queue: enqueue('webhook-execution', payload)
Queue-->>Processor: jobId
alt provider === 'generic' && responseMode === 'custom'
Processor->>Processor: Read responseStatusCode & responseBody from providerConfig
Processor-->>Caller: Custom HTTP response (status + body)
else default
Processor-->>Caller: 200 { message: 'Webhook processed' }
end
Queue->>TriggerHandler: execute(ctx, block, inputs)
TriggerHandler->>TriggerHandler: Check existingState.output (truthy check only now)
TriggerHandler-->>Queue: trigger output
end
Last reviewed commit: 69cd0fd |
|
bugbot run |
|
bugbot run |
Summary
Deduplication and Custom Acknowledgemetn Configuration for generic webhooks.
Type of Change
Testing
Tested manually
Checklist