Skip to content

feat(triggers): service-account credentials in the hubspot trigger#5693

Open
TheodoreSpeaks wants to merge 1 commit into
stagingfrom
feat/hubspot-service-account
Open

feat(triggers): service-account credentials in the hubspot trigger#5693
TheodoreSpeaks wants to merge 1 commit into
stagingfrom
feat/hubspot-service-account

Conversation

@TheodoreSpeaks

@TheodoreSpeaks TheodoreSpeaks commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Staging's feat(credentials): token-paste service accounts for 12 providers #5682 shipped HubSpot (and 11 other) token-paste service accounts while this PR was in review, superseding the provider work here — this PR is now rebased on it and carries only what feat(credentials): token-paste service accounts for 12 providers #5682 doesn't have:
  • HubSpot CRM Trigger accepts service-account credentials: the polling credential resolver (resolveOAuthCredential) resolves service_account credentials via resolveServiceAccountToken, and a new allowServiceAccounts subblock flag opts the trigger's credential picker into listing them (enabled on the HubSpot poller)
  • 409 duplicate_display_name on token service-account create collisions (all 12 providers): previously a name match fell through to the existing-credential path and silently dropped the submitted token; the token modal already maps this code to a friendly message
  • Docs: note trigger support on the HubSpot service-account page

Type of Change

  • New feature

Testing

Tested manually. lint, tsc, and check:api-validation:strict 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

vercel Bot commented Jul 15, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Jul 15, 2026 7:58pm

Request Review

@cursor

cursor Bot commented Jul 15, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes webhook polling auth and credential-create collision handling; limited scope (HubSpot trigger + token service accounts) but affects production polling and secret storage.

Overview
HubSpot CRM Trigger can use private app (service account) credentials end-to-end: polling resolves service_account credentials via resolveServiceAccountToken in resolveOAuthCredential, and a new allowServiceAccounts flag on trigger oauth-input subblocks shows those credentials in the picker (enabled on the HubSpot poller).

Credential create API now returns 409 duplicate_display_name when a token-based service account is created with a name that already exists, instead of treating the request as success and discarding the new token.

Docs on the HubSpot service-account page mention the CRM Trigger and why a non-expiring token suits polling.

Reviewed by Cursor Bugbot for commit e212cda. Bugbot is set up for automated code reviews on this repo. Configure here.

@greptile-apps

greptile-apps Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds service-account credentials to the HubSpot polling trigger. The main changes are:

  • Lists service accounts in the HubSpot trigger credential selector.
  • Resolves stored service-account tokens during polling.
  • Returns a conflict when token credentials reuse a display name.
  • Documents HubSpot trigger support for service accounts.

Confidence Score: 5/5

This looks safe to merge.

  • The display-name collision now fails clearly instead of discarding the submitted token.
  • The polling resolver accepts the new service-account selection path.
  • No blocking issue remains in the updated code.

Important Files Changed

Filename Overview
apps/sim/app/api/credentials/route.ts Returns a clear conflict response when a token service account reuses an existing display name.
apps/sim/lib/webhooks/polling/utils.ts Resolves service-account credentials to stored access tokens for polling.
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/credential-selector/credential-selector.tsx Lets eligible trigger configurations include service accounts in the credential list.
apps/sim/blocks/types.ts Adds the optional service-account selector flag to sub-block configuration.
apps/sim/triggers/hubspot/poller.ts Enables service accounts for the HubSpot polling trigger.
apps/docs/content/docs/en/integrations/hubspot-service-account.mdx Documents HubSpot service-account use with workflows and polling triggers.

Reviews (4): Last reviewed commit: "feat(triggers): service-account credenti..." | Re-trigger Greptile

Comment thread apps/sim/lib/credentials/hubspot-service-account.ts Outdated
@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ 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 e244a7a. Configure here.

Comment thread apps/sim/lib/credentials/hubspot-service-account.ts Outdated
@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ 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 a523223. Configure here.

@TheodoreSpeaks TheodoreSpeaks force-pushed the feat/hubspot-service-account branch from a523223 to e212cda Compare July 15, 2026 19:53
@TheodoreSpeaks TheodoreSpeaks changed the title feat(credentials): add hubspot service account support feat(triggers): service-account credentials in the hubspot trigger Jul 15, 2026
@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ 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 e212cda. 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.

1 participant