feat: add HubSpot action#44
Open
nicosammito wants to merge 1 commit into
Open
Conversation
GitLab Pipeline ActionGeneral informationLink to pipeline: https://gitlab.com/code0-tech/development/centaurus/-/pipelines/2701104114 Status: Failed Job summariesdocs:previewDocumentation preview available at https://code0-tech.gitlab.io/-/development/telescopium/-/jobs/15504651190/artifacts/out/index.html |
This was referenced Jul 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a HubSpot CRM action so Hercules flows can react to HubSpot webhooks and drive CRM records (create/update/search/associate/annotate). Implements issue #41, mirroring the existing actions' conventions (
shopify-actionforRestwebhook triggers;gls-action/twilio-actionfor functions, config, andhelpers.ts).SDK / schema source (rule 1)
Uses the official
@hubspot/api-client^14SDK for all API logic. HubSpot CRM objects (contacts, deals, companies, notes) all share the SDK'sSimplePublicObjectenvelope (id,properties, timestamps,archived), so the object data types are modeled once on that shape and reused rather than hand-duplicated per object. Every API response is validated withzod.parse()before being returned to a flow.Triggers (4,
extends Rest)HubSpotContactCreatedWebhook—contact.creationHubSpotDealCreatedWebhook—deal.creationHubSpotDealStageChangedWebhook—deal.propertyChangeondealstageHubSpotFormSubmittedWebhook— form submission (lead capture)Functions (9)
hubspotCreateContact,hubspotUpdateContact,hubspotGetContactByEmail,hubspotCreateDeal,hubspotUpdateDeal,hubspotCreateCompany,hubspotAddNote,hubspotAssociate,hubspotSearchObjects.Data types (6)
HUBSPOT_CONTACT,HUBSPOT_DEAL,HUBSPOT_COMPANY,HUBSPOT_NOTE,HUBSPOT_SEARCH_RESULT,HUBSPOT_WEBHOOK_EVENT.Config
access_token(required, Bearer private-app token),app_id(optional),client_secret(optional, for webhook signature validation).Registration
Added
hubspot-actionto.node-actionsin.gitlab-ci.ymland a row to the rootREADME.md"Available Actions" table.Design choices (noted)
hubspotAssociateuses the v4 default-association endpoint (createDefault) to avoid hard-coding version-specific association type ids.Validation
Run in
actions/hubspot-action/:npm install— OK (210 packages)npm run typecheck— ✅ PASS (0 errors; typechecks against the real@hubspot/api-client@14types, confirming the SDK method paths)npm run build— ✅ PASS (dist/index.js, 33.7 kB)npm run test— ✅ PASS (8/8 vitest specs)Note
One follow-up required:
package-lock.jsonwas generated locally but is not in this commit (too large to include via the automation). CI'stest-nodejob runsnpm ci, which requires it — please runnpm installinactions/hubspot-action/and commit the lockfile before merge.Closes #41