improvement(instantly): validate integration against live API, add lead/campaign lifecycle tools#5448
Conversation
…ad/campaign lifecycle tools - Verify all existing Instantly tools against the live API v2 spec - Add instantly_patch_lead, instantly_pause_campaign, instantly_delete_campaign - Fix activate_campaign response mapping to surface the full campaign object - Restore status/ai_sales_agent_id list_campaigns filters
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview The block adds matching operations, reuses create-lead field sub-blocks for patch lead via Activate, pause, and delete campaign tools now use Reviewed by Cursor Bugbot for commit 154a6a8. Configure here. |
Greptile SummaryThis PR validates the Instantly integration against the live v2 API and expands tool coverage with three new tools (
Confidence Score: 5/5Safe to merge — the new tools follow established patterns exactly, the activate_campaign type change is purely additive, and no existing tool contracts are broken. All three new tools (patch_lead, pause_campaign, delete_campaign) mirror the structure of pre-existing tools (get_lead, activate_campaign) — same utils helpers, same output schema conventions, same registration pattern. The activate_campaign output type update only adds a message field and is backward-compatible. The empty-body guard added to patch_lead is a genuine correctness improvement. No logic paths are removed or altered in a way that could regress existing workflows. No files require special attention. Important Files Changed
Sequence Diagram%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant UI as Block UI
participant Block as InstantlyBlock config
participant Registry as Tool Registry
participant API as Instantly API v2
UI->>Block: "operation = patch_lead, leadId, first_name, ..."
Block->>Registry: instantly_patch_lead(leadId, first_name, ...)
Registry->>API: "PATCH /api/v2/leads/{leadId}"
API-->>Registry: InstantlyLead object
Registry-->>UI: "{ lead, id, email_address, first_name, ... }"
UI->>Block: "operation = pause_campaign, campaignId"
Block->>Registry: instantly_pause_campaign(campaignId)
Registry->>API: "POST /api/v2/campaigns/{campaignId}/pause"
API-->>Registry: Campaign object + message
Registry-->>UI: "{ campaign, id, name, status, message }"
UI->>Block: "operation = delete_campaign, campaignId"
Block->>Registry: instantly_delete_campaign(campaignId)
Registry->>API: "DELETE /api/v2/campaigns/{campaignId}"
API-->>Registry: Campaign object + message
Registry-->>UI: "{ campaign, id, name, status, message }"
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant UI as Block UI
participant Block as InstantlyBlock config
participant Registry as Tool Registry
participant API as Instantly API v2
UI->>Block: "operation = patch_lead, leadId, first_name, ..."
Block->>Registry: instantly_patch_lead(leadId, first_name, ...)
Registry->>API: "PATCH /api/v2/leads/{leadId}"
API-->>Registry: InstantlyLead object
Registry-->>UI: "{ lead, id, email_address, first_name, ... }"
UI->>Block: "operation = pause_campaign, campaignId"
Block->>Registry: instantly_pause_campaign(campaignId)
Registry->>API: "POST /api/v2/campaigns/{campaignId}/pause"
API-->>Registry: Campaign object + message
Registry-->>UI: "{ campaign, id, name, status, message }"
UI->>Block: "operation = delete_campaign, campaignId"
Block->>Registry: instantly_delete_campaign(campaignId)
Registry->>API: "DELETE /api/v2/campaigns/{campaignId}"
API-->>Registry: Campaign object + message
Registry-->>UI: "{ campaign, id, name, status, message }"
Reviews (2): Last reviewed commit: "fix(instantly): guard against empty patc..." | Re-trigger Greptile |
Follows the same pattern used in tools/langsmith/update_run.ts.
|
@greptile review |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 154a6a8. Configure here.
Summary
instantly_patch_lead(update a lead),instantly_pause_campaign,instantly_delete_campaign— campaign lifecycle previously only had activateactivate_campaign/pause_campaign/delete_campaignto correctly map the full campaign object the API actually returns (not just a message)list_campaigns'status/ai_sales_agent_idfilters are real, documented params — kept thempatch_leadcorrectly excludesemail(immutable on that endpoint) and includesassigned_toType of Change
Testing
bun run lintcleanbunx tsc --noEmitcleanChecklist