Skip to content

improvement(apollo): align tools and block with Apollo API docs#4487

Open
waleedlatif1 wants to merge 19 commits intostagingfrom
waleedlatif1/validate-apollo
Open

improvement(apollo): align tools and block with Apollo API docs#4487
waleedlatif1 wants to merge 19 commits intostagingfrom
waleedlatif1/validate-apollo

Conversation

@waleedlatif1
Copy link
Copy Markdown
Collaborator

Summary

  • aligned all 25 Apollo tools and the block with the official Apollo API (verified via context7 docs)
  • fixed endpoints (account_create canonical path, task_create flat body, sequence_add response shape)
  • bulk_update tools now accept array-shaped attributes; added uniform name/owner_id for account_bulk_update
  • added documented optional fields across people/org/contact/account/opportunity search and create/update flows
  • preserved subBlock IDs for backwards compatibility via params remapping; defensive migration entries already present

Type of Change

  • Improvement

Testing

Tested manually. Lint and typecheck pass.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link
Copy Markdown

vercel Bot commented May 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment May 7, 2026 9:42pm

Request Review

@cursor
Copy link
Copy Markdown

cursor Bot commented May 7, 2026

PR Summary

Medium Risk
Touches many Apollo tool request/response shapes and block parameter mappings, so misalignment could break existing workflows or change outputs even though migrations/remapping aim to preserve compatibility.

Overview
Updates the Apollo integration end-to-end (docs, SIM block UI, tool implementations, and types) to match current Apollo API behavior and expand supported filters/fields across people/org/contact/account/opportunity/sequence/task operations.

Several tools change request/response contracts: bulk create/update endpoints now accept richer payloads (incl. dedupe/labels, uniform updates, async jobs), people/org enrich add webhook-based phone reveal and revised outputs, opportunity search switches to a GET+querystring model, and sequence/task endpoints are updated for required send-from email account + new response shapes. The Apollo block adds corresponding UI fields, improves JSON parsing/mapping (incl. splitting bulk update inputs), and a migration map preserves prior subblock parameter IDs.

Reviewed by Cursor Bugbot for commit 78407fd. Configure here.

Comment thread apps/sim/blocks/blocks/apollo.ts
Comment thread apps/sim/blocks/blocks/apollo.ts Outdated
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 7, 2026

Greptile Summary

This PR aligns 25 Apollo tools and the block with the official Apollo API documentation, fixing endpoint paths, field names, and response shapes across all operations. Guard logic and runtime validations from previous review rounds are now in place.

  • Renamed and added documented API fields across account, contact, opportunity, sequence, and task operations; changed amount type to string, stage_id → opportunity_stage_id, close_date → closed_date, etc.
  • Added sub-block ID migrations for renamed fields (close_date, stage_id, note); account_bulk_update and contact_bulk_update now accept both per-contact array form and ID+attributes form with explicit runtime guards.
  • task_create moved to the bulk_create endpoint accepting contact_ids[]; sequence_add_contacts added send_email_from_email_account_id as a required field; people_bulk_enrich moved reveal_personal_emails and reveal_phone_number to query params.

Confidence Score: 5/5

Safe to merge — all previously identified issues have been addressed in follow-up commits and no new defects were found.

All 25 tools and the block have been audited. The guard logic in bulk-update tools correctly covers every invalid input combination. Sub-block migrations cover all renamed fields. The sequence_add and task_create endpoints now match the Apollo API contract. No new runtime errors or silent data drops were found.

No files require special attention.

Important Files Changed

Filename Overview
apps/sim/blocks/blocks/apollo.ts Large block refactor: adds new subblocks for sequence_add, task_create, contact/account operations; adds splitBulkUpdateInput helper and remapping logic for renamed params. No issues found.
apps/sim/lib/workflows/migrations/subblock-migrations.ts Adds apollo migration entry covering close_date→closed_date, stage_id→opportunity_stage_id, note→task_notes, and two defensive entries. All addressed renames are covered.
apps/sim/tools/apollo/account_bulk_update.ts Refactored to accept account_ids+name/owner_id or account_attributes (array or object form); three sequential guards catch all invalid states. Logic is sound after previous-round fixes.
apps/sim/tools/apollo/contact_bulk_update.ts Accepts contact_ids+object-form attributes or standalone array-form attributes; guards correctly require contact_attributes and reject object form without contact_ids.
apps/sim/tools/apollo/sequence_add_contacts.ts Expanded with full Apollo API fields; guard ensures at least one of contact_ids/label_names is present; send_email_from_email_account_id is now correctly required.
apps/sim/tools/apollo/task_create.ts Migrated to bulk_create endpoint accepting contact_ids[]; user_id, type, status, due_at are now required per API docs.
apps/sim/tools/apollo/people_bulk_enrich.ts Moved reveal_personal_emails and reveal_phone_number to query string; added webhook_url; response handling now covers both matches and people array shapes.
apps/sim/tools/apollo/opportunity_create.ts Renamed stage_id→opportunity_stage_id, close_date→closed_date, amount to string type; account_id made optional; description replaced with typed_custom_fields.
apps/sim/tools/apollo/account_create.ts Renamed website_url→domain to match block subblock; added account_stage_id, raw_address, typed_custom_fields; response fallback to data.id shape.
apps/sim/tools/apollo/types.ts Comprehensive type updates for all 25 tools matching the new param shapes; no issues found.

Reviews (11): Last reviewed commit: "docs" | Re-trigger Greptile

Comment thread apps/sim/blocks/blocks/apollo.ts
Comment thread apps/sim/blocks/blocks/apollo.ts
Comment thread apps/sim/tools/apollo/contact_bulk_update.ts
Comment thread apps/sim/tools/apollo/sequence_add_contacts.ts Outdated
Comment thread apps/sim/tools/apollo/organization_bulk_enrich.ts
@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@cursor review

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

bugbot run

Comment thread apps/sim/tools/apollo/account_bulk_update.ts
Comment thread apps/sim/tools/apollo/contact_bulk_update.ts
@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@cursor review

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@greptile

Comment thread apps/sim/lib/workflows/migrations/subblock-migrations.ts
@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@cursor review

Comment thread apps/sim/tools/apollo/account_bulk_update.ts
Comment thread apps/sim/blocks/blocks/apollo.ts
Comment thread apps/sim/blocks/blocks/apollo.ts
@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@cursor review

Comment thread apps/sim/blocks/blocks/apollo.ts
Comment thread apps/sim/tools/apollo/task_create.ts Outdated
@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@cursor review

Comment thread apps/sim/blocks/blocks/apollo.ts
Comment thread apps/sim/blocks/blocks/apollo.ts
Comment thread apps/sim/lib/workflows/migrations/subblock-migrations.ts
waleedlatif1 and others added 2 commits May 7, 2026 14:36
Final pass over the Apollo integration after a per-tool forensic audit
against Apollo.io docs. Notable fixes:

- organization_enrich: GET+querystring -> POST+JSON body (canonical, non
  master-key)
- organization_bulk_enrich: ?domains[]= -> JSON body { organizations }
- people_search: declare/forward organization_num_employees_ranges; fix
  contact_email_status placeholder ("likely to engage", with spaces)
- account_bulk_create: surface failed_accounts and failed count
- contact_bulk_create: expand documented per-contact fields (CRM IDs,
  phone_numbers, contact_emails, typed_custom_fields, etc.)
- sequence_add_contacts: surface remaining documented filter params
- task_create: confirm wire field name (note) and remap from task_notes
- types: tighten params/responses for the above

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@cursor review

Comment thread apps/sim/tools/apollo/organization_bulk_enrich.ts
@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@cursor review

Comment thread apps/sim/blocks/blocks/apollo.ts
@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@cursor review

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 78407fd. Configure here.

close_date: 'closed_date',
stage_id: 'opportunity_stage_id',
note: 'task_notes',
},
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing subblock migration for account website_url to domain

Medium Severity

The website_url subBlock for account_create and account_update operations was replaced with domain, but no migration entry was added to SUBBLOCK_ID_MIGRATIONS. Existing saved workflows that stored a website_url value for account operations will silently lose that data — the old value remains as an orphaned key while the new domain subBlock starts empty. Other renamed fields like close_date, stage_id, and note all have migration entries, but website_url does not.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 78407fd. Configure here.

close_date: 'closed_date',
stage_id: 'opportunity_stage_id',
note: 'task_notes',
},
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed opportunity/task subBlocks lack migration cleanup entries

Low Severity

Several subBlock IDs were removed without _removed_* migration entries: description (opportunity create/update), account_ids/stage_ids/owner_ids (opportunity search), q_keywords (opportunity/account search), contact_id/account_id (task create), completed (task search), and active (sequence search). Existing workflows retain these orphaned values in state, and those values silently pass through parsedParams to tool body functions that no longer use them. The ashby block follows the _removed_* pattern for this exact scenario.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 78407fd. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants