Skip to content

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

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

improvement(apollo): align tools and block with Apollo API docs#4487
waleedlatif1 wants to merge 13 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.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped May 7, 2026 7:53am

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 UI-to-API parameter mapping, so existing workflows could break if migrations/mappings miss edge cases despite added backwards-compat renames.

Overview
Aligns the Apollo integration’s tool contracts and block UI with current Apollo API behavior, expanding supported filters/fields across people/org/contact/account/opportunity flows and updating docs accordingly.

Several tools change request semantics and endpoints (e.g., organization_enrich and opportunity_search move to query-based GETs; bulk enrich adds query params; IDs are trimmed), and multiple outputs are reshaped to match Apollo responses (e.g., bulk enrich matches + counts/credits, sequence add returning added/skipped, bulk updates returning message/job_id).

Updates the Apollo block’s input schema and param processing to parse more JSON fields, remap legacy/renamed fields (including new SUBBLOCK_ID_MIGRATIONS for Apollo), and support new bulk-update modes (*_ids + uniform attributes).

Reviewed by Cursor Bugbot for commit aa52f0d. 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 all 25 Apollo tools and the block with the official Apollo API, fixing endpoint paths, field names (closed_date, opportunity_stage_id, domain), request shapes, and bulk-update body structures. Subblock migrations and block-level param remappings are included to preserve backwards compatibility for saved workflows.

  • Endpoint and field corrections: account_create uses the canonical /api/v1/accounts path; opportunity_create/update use closed_date/opportunity_stage_id; organization_bulk_enrich passes domains via query string (no body) and correctly drops Content-Type.
  • Bulk-update guards added: contact_bulk_update now throws when contact_attributes is absent; account_bulk_update has a two-stage guard; sequence_add_contacts throws when neither contact_ids nor label_names is provided.
  • Migration table updated: close_date → closed_date and stage_id → opportunity_stage_id entries added; website_url → domain intentionally omitted due to ambiguity with contact operations.

Confidence Score: 4/5

Safe to merge with the object-form/missing-IDs guard gap addressed in the two bulk-update tools.

Both contact_bulk_update and account_bulk_update explicitly handle a non-array object form of their _attributes param, but neither guard checks whether target IDs are also absent in that path. A caller who passes contact_attributes: { title: "CEO" } (object, not array) without contact_ids clears all guards and sends Apollo a body with no target — resulting in an API error rather than the clear validation message the guards are designed to provide. The rest of the alignment work (endpoint fixes, field renames, migration entries, remap logic) is correct and well-structured.

apps/sim/tools/apollo/contact_bulk_update.ts and apps/sim/tools/apollo/account_bulk_update.ts — both need a cross-check between the object form of _attributes and the presence of the corresponding _ids field.

Important Files Changed

Filename Overview
apps/sim/tools/apollo/account_bulk_update.ts Added two-stage validation guards for empty-body case; however, the second guard passes when account_attributes is a non-array object with no account_ids, allowing a body with no target IDs to reach Apollo.
apps/sim/tools/apollo/contact_bulk_update.ts Guard now requires contact_attributes, but the object-form path (non-array attributes applied to contact_ids) is not validated: missing contact_ids when using an object passes through silently and reaches Apollo without target IDs.
apps/sim/blocks/blocks/apollo.ts All remappings present (task_notes→note, sequence_add_label_names→label_names, account_bulk_update_name→name, etc.); block correctly routes 25 operations with updated subblock IDs matching current tool param names.
apps/sim/lib/workflows/migrations/subblock-migrations.ts Added close_date→closed_date and stage_id→opportunity_stage_id migrations for Apollo; website_url→domain intentionally omitted due to ambiguity with contact ops. Pattern is correct.
apps/sim/tools/apollo/sequence_add_contacts.ts Runtime guard added requiring either contact_ids or label_names; response parsing covers both new contacts.added/skipped and legacy skipped_contact_ids shapes.
apps/sim/tools/apollo/organization_bulk_enrich.ts Content-Type header removed (correct for body-less POST with query-string domains); domain-param URL builder and response mapping look correct.
apps/sim/tools/apollo/task_create.ts Flat-body format aligned with Apollo bulk_create endpoint; note field forwarded correctly after block-level remap of task_notes→note.
apps/sim/tools/apollo/opportunity_create.ts Renamed fields (closed_date, opportunity_stage_id) align with Apollo API; body builder correctly omits empty/null amount.
apps/sim/tools/apollo/account_create.ts Endpoint corrected to canonical /api/v1/accounts path; domain field replaces website_url; body builder clean.
apps/sim/tools/apollo/account_bulk_create.ts Handles both created_accounts and existing_accounts from Apollo response; 100-item slice applied correctly.

Reviews (5): Last reviewed commit: "fix(apollo): tighten account_bulk_update..." | 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/tools/apollo/account_bulk_update.ts
@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@cursor review

Comment thread apps/sim/tools/apollo/contact_bulk_update.ts
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 1 potential issue.

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 aa52f0d. Configure here.

Comment thread apps/sim/tools/apollo/contact_bulk_update.ts
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.

1 participant