feat(integrations): claude skills to add integrations, lemlist trigger + tools, remove test webhook url#2785
Conversation
…r + tools, remove test webhook url
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥 |
Greptile OverviewGreptile SummaryThis PR adds three major features: Claude Code Skills for integration development, Lemlist integration with tools/blocks/triggers, and removal of test webhook functionality. What Changed1. Claude Code Skills (.claude/commands/)Four new skills provide comprehensive guidance for adding integrations:
These are well-documented guides with examples and checklists. 2. Lemlist IntegrationTools (3): Get Activities, Get Lead, Send Email - all properly structured with correct parameter visibility and nullable field handling. Block: Single block with operation dropdown supporting all 3 tools, plus 9 webhook triggers. Uses API key authentication. Triggers (9): Email Replied (primary with dropdown), LinkedIn Replied, Interested, Not Interested, Email Opened, Email Clicked, Email Bounced, Email Sent, and Generic Webhook. Webhook Infrastructure: Automatic webhook creation/deletion in Lemlist API with proper error handling and rollback on failure. 3. Test Webhook RemovalRemoved all test webhook functionality to force deployment-based testing:
Critical Issues Found1. Duplicate SubBlock ID (BLOCKER)
2. Missing Webhook Event Filtering (HIGH)
3. Unused Webhook Processing Functions (HIGH)
4. Generic Webhook Configuration Issues (MEDIUM)
Positive Aspects
Confidence Score: 2/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant User
participant WebhookAPI as Webhook API<br/>(POST /api/webhooks)
participant DB as Database
participant Lemlist as Lemlist API
participant TriggerAPI as Trigger API<br/>(/api/webhooks/trigger/{path})
participant Processor as Webhook Processor
participant Queue as Trigger.dev Queue
participant Workflow as Workflow Engine
Note over User,Workflow: Webhook Setup Flow
User->>WebhookAPI: Create webhook with apiKey + triggerId
WebhookAPI->>DB: Save webhook record
DB-->>WebhookAPI: savedWebhook
alt provider === 'lemlist'
WebhookAPI->>WebhookAPI: createLemlistWebhookSubscription()
WebhookAPI->>Lemlist: POST /api/hooks<br/>{targetUrl, type, campaignId}
alt Success
Lemlist-->>WebhookAPI: {_id: webhookId}
WebhookAPI->>DB: Update with externalId
else API Error (401/403)
Lemlist-->>WebhookAPI: Error
WebhookAPI->>DB: Rollback - delete webhook
WebhookAPI-->>User: Error: Invalid API Key
end
end
WebhookAPI-->>User: Webhook created
Note over User,Workflow: Webhook Trigger Flow
Lemlist->>TriggerAPI: POST /api/webhooks/trigger/{path}<br/>{type, leadId, campaignId...}
TriggerAPI->>Processor: findAllWebhooksForPath(path)
Processor->>DB: Query webhooks by path
DB-->>Processor: webhooks
TriggerAPI->>Processor: checkWebhookPreprocessing()
Processor->>Processor: Check rate limits & deployment
TriggerAPI->>Processor: shouldSkipWebhookEvent()
Note right of Processor: ⚠️ Missing Lemlist filtering!<br/>Should check eventTypes
TriggerAPI->>Processor: queueWebhookExecution()
Processor->>Queue: trigger('webhook-execution', payload)
Queue->>Workflow: Execute with triggerData
Workflow-->>User: Workflow runs
TriggerAPI-->>Lemlist: 200 OK
Note over User,Workflow: Webhook Deletion Flow
User->>WebhookAPI: DELETE webhook
WebhookAPI->>DB: Delete webhook record
WebhookAPI->>Processor: cleanupExternalWebhook()
alt provider === 'lemlist'
Processor->>Processor: deleteLemlistWebhook()
Processor->>Lemlist: DELETE /api/hooks/{externalId}
alt Success or 404
Lemlist-->>Processor: OK
else Error (non-fatal)
Lemlist-->>Processor: Error
Note right of Processor: Log warning, continue
end
end
WebhookAPI-->>User: Deleted
|
Additional Comments (1)
Without this, the Impact: Users who configure Fix: Add Lemlist event filtering similar to Stripe and Grain: Prompt To Fix With AIThis is a comment left during a code review.
Path: apps/sim/lib/webhooks/processor.ts
Line: 225:255
Comment:
Missing Lemlist event filtering logic in `shouldSkipWebhookEvent`. The PR adds a generic Lemlist webhook trigger (`lemlist_webhook`) that supports `eventTypes` filtering (see `apps/sim/triggers/lemlist/webhook.ts` lines 28-56), but this function doesn't implement the filtering logic.
Without this, the `lemlist_webhook` trigger will receive ALL events even when specific `eventTypes` are configured, defeating the purpose of the filter.
**Impact:** Users who configure `lemlist_webhook` with specific event types (e.g., only "Email Sent" and "Email Opened") will still receive all event types, causing unnecessary workflow executions.
**Fix:** Add Lemlist event filtering similar to Stripe and Grain:
```suggestion
if (webhook.provider === 'grain') {
const eventTypes = providerConfig.eventTypes
if (eventTypes && Array.isArray(eventTypes) && eventTypes.length > 0) {
const eventType = body?.type
if (eventType && !eventTypes.includes(eventType)) {
logger.info(
`[${requestId}] Grain event type '${eventType}' not in allowed list for webhook ${webhook.id}, skipping`
)
return true
}
}
}
if (webhook.provider === 'lemlist') {
const eventTypes = providerConfig.eventTypes
if (eventTypes && Array.isArray(eventTypes) && eventTypes.length > 0) {
const eventType = body?.type || body?.eventType
if (eventType && !eventTypes.includes(eventType)) {
logger.info(
`[${requestId}] Lemlist event type '${eventType}' not in allowed list for webhook ${webhook.id}, skipping`
)
return true
}
}
}
return false
}
```
How can I resolve this? If you propose a fix, please make it concise. |
Summary
Multi part PR:
Quick path: Just use /add-integration — it orchestrates everything.
Lemlist Trigger and Tools
No more test webhook URL. Must deploy to test webhooks.
Type of Change
Testing
Tested manually
Checklist