-
Notifications
You must be signed in to change notification settings - Fork 5.5k
18199 action hubspot workflow api #18252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Implemented new actions for managing workflows in HubSpot, including: - Create a new workflow - Retrieve workflow details - Retrieve emails associated with a workflow - Retrieve multiple workflows by their IDs - Retrieve migrated workflow mappings - Update an existing workflow - Delete a workflow - Added corresponding methods in the hubspot.app.mjs for API interactions. - Updated constants and added necessary props for each action.
- Refactored workflow-related actions to align with the v4 API, including: - Updated endpoints and request structures for creating, retrieving, updating, and deleting workflows. - Added new properties for workflow creation and management, such as `isEnabled`, `actions`, and `enrollmentCriteria`. - Enhanced error handling and response parsing for better integration. - Bumped package version to 1.7.0 to reflect these changes.
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
WalkthroughAdds HubSpot workflow support: new workflow actions (create, delete, list, details, emails, migrated mappings), app-level workflow methods and propDefinitions, AUTOMATIONV3 constant, plus many HubSpot metadata version bumps and description reformatting across sources. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant Action as Create Workflow Action
participant App as HubSpot App
participant HubSpot as HubSpot API (v3)
User->>Action: provide name, type, actions[]
Action->>App: createWorkflow({ name, type, actions })
App->>HubSpot: POST /automation/v3/workflows
HubSpot-->>App: 201 + workflow
App-->>Action: response
Action-->>User: summary + response
sequenceDiagram
autonumber
actor User
participant Action as Retrieve Migrated Mappings Action
participant App as HubSpot App
participant HubSpot as HubSpot API (v4)
User->>Action: provide flowIds[] and/or workflowIds[]
Action->>Action: parse inputs → payload
Action->>App: getMigratedWorkflowMappings({ data.inputs })
App->>HubSpot: POST /automation/v4/workflow-id-mappings/batch/read
HubSpot-->>App: results + errors[]
App-->>Action: response
Action-->>User: summary (#results, #errors) + response
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
Pre-merge checks (1 passed, 3 warnings, 1 inconclusive)❌ Failed checks (3 warnings, 1 inconclusive)
✅ Passed checks (1 passed)
Poem
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal). Please share your feedback with us on this Discord post. 📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (10)
✅ Files skipped from review due to trivial changes (2)
🚧 Files skipped from review as they are similar to previous changes (8)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 7
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
components/hubspot/hubspot.app.mjs (1)
1241-1309
: Add batch read helper to support the batch action.Expose POST /automation/v4/flows/batch/read.
Add this method alongside the other workflow methods:
getWorkflowsBatchRead(opts = {}) { return this.makeRequest({ api: API_PATH.AUTOMATIONV4, endpoint: "/flows/batch/read", method: "POST", ...opts, }); }
🧹 Nitpick comments (15)
components/hubspot/actions/retrieve-workflow-details/retrieve-workflow-details.mjs (1)
6-6
: Doc link: consider switching to the stable Automation v4 overview page.
The “api-reference” deep link structure tends to change. The overview page for Automation v4 (BETA) consistently documents GET /automation/v4/flows/{flowId}. Suggest updating the link to the overview for durability. (developers.hubspot.com)- description: "Retrieve detailed information about a specific workflow. [See the documentation](https://developers.hubspot.com/docs/api-reference/automation-automation-v4-v4/workflows/get-automation-v4-flows-flowId)", + description: "Retrieve detailed information about a specific workflow. [See the documentation](https://developers.hubspot.com/docs/api/automation/workflows)",components/hubspot/actions/retrieve-workflow-emails/retrieve-workflow-emails.mjs (2)
23-27
: Fix the “Before” paging description (should reference paging.prev.before).
HubSpot’s response model exposes before under paging.prev, not paging.next. (developers.hubspot.com)- description: "The paging cursor token of the last successfully read resource will be returned as the `paging.next.before` JSON property of a paged response containing more results.", + description: "The paging cursor token of the last successfully read resource will be returned as the `paging.prev.before` JSON property of a paged response containing previous results.",
48-49
: Guard summary against undefined results.
Minor UX improvement if results is missing.- $.export("$summary", `Successfully retrieved ${response.results.length} emails for workflow ${this.workflowId}`); + $.export("$summary", `Successfully retrieved ${response?.results?.length ?? 0} emails for workflow ${this.workflowId}`);components/hubspot/actions/create-workflow/create-workflow.mjs (3)
7-7
: Doc link: consider using the Automation v4 overview page for stability.
It documents POST /automation/v4/flows and tends to be more stable than deep “api-reference” paths. (developers.hubspot.com)- description: "Create a new workflow. [See the documentation](https://developers.hubspot.com/docs/api-reference/automation-automation-v4-v4/workflows/post-automation-v4-flows)", + description: "Create a new workflow. [See the documentation](https://developers.hubspot.com/docs/api/automation/workflows)",
24-28
: Expose objectTypeId instead of hardcoding contacts.
The example GET response shows contact-based flows use objectTypeId "0-1". For broader support (e.g., platform flows), make this a prop and include it conditionally so non-contact flows aren’t forced to 0-1. (developers.hubspot.com)type: { propDefinition: [ hubspot, "type", ], }, + objectTypeId: { + type: "string", + label: "Object Type ID", + description: "HubSpot object type ID for the enrolled object (e.g., contacts are typically 0-1). Optional; used mainly for contact-based flows.", + optional: true, + },
44-54
: Build request body conditionally; avoid forcing objectTypeId for non-contact flows.
Also add light validation around JSON inputs to surface parse errors early. (developers.hubspot.com)- const response = await this.hubspot.createWorkflow({ - data: { - name: this.name, - type: this.type, - isEnabled: this.isEnabled, - objectTypeId: "0-1", - flowType: "WORKFLOW", - actions: parseObject(this.actions), - enrollmentCriteria: parseObject(this.enrollmentCriteria), - }, - $, - }); + const data = { + name: this.name, + type: this.type, + isEnabled: this.isEnabled, + flowType: "WORKFLOW", + }; + try { + if (this.actions) data.actions = parseObject(this.actions); + if (this.enrollmentCriteria) data.enrollmentCriteria = parseObject(this.enrollmentCriteria); + } catch (err) { + throw new Error(`Invalid JSON in actions or enrollmentCriteria: ${err.message}`); + } + if (this.type === "CONTACT_FLOW") { + data.objectTypeId = this.objectTypeId || "0-1"; + } + const response = await this.hubspot.createWorkflow({ data, $ });components/hubspot/actions/retrieve-workflows/retrieve-workflows.mjs (2)
6-6
: Doc link: consider using the Automation v4 overview page.
Stable page covering GET /automation/v4/flows. (developers.hubspot.com)- description: "Retrieve a list of all workflows. [See the documentation](https://developers.hubspot.com/docs/api-reference/automation-automation-v4-v4/workflows/get-automation-v4-flows)", + description: "Retrieve a list of all workflows. [See the documentation](https://developers.hubspot.com/docs/api/automation/workflows)",
34-35
: Guard summary when results is missing.
Minor polish.- $.export("$summary", `Successfully retrieved ${response.results.length} workflows`); + $.export("$summary", `Successfully retrieved ${response?.results?.length ?? 0} workflows`);components/hubspot/actions/retrieve-migrated-workflow-mappings/retrieve-migrated-workflow-mappings.mjs (1)
55-56
: Harden summary for missing fields.Guard against undefined
results
/errors
.- $.export("$summary", `Successfully retrieved ${response.results.length} migrated result(s) with ${response.errors?.length || 0} error(s)`); + const resultsLen = response.results?.length ?? 0; + const errorsLen = response.errors?.length ?? 0; + $.export("$summary", `Successfully retrieved ${resultsLen} migrated result(s) with ${errorsLen} error(s)`);components/hubspot/actions/retrieve-batch-workflows/retrieve-batch-workflows.mjs (2)
24-25
: Default to an empty array when parsing IDs.Avoids
length
/iteration onundefined
.- const parsedWorkflowIds = parseObject(this.workflowIds); + const parsedWorkflowIds = parseObject(this.workflowIds) || [];
1-39
: Optionally fetch in parallel with limiter.If you keep per-ID GETs, wrap with
Promise.all
to simplify and let the Bottleneck limiter handle throughput.components/hubspot/actions/update-workflow/update-workflow.mjs (4)
25-36
: Make update fields optionalFor partial updates, these should not be required. Add
optional: true
to avoid forcing inputs.type: { propDefinition: [ hubspot, "type", ], }, isEnabled: { propDefinition: [ hubspot, "isEnabled", ], + optional: true, },
(If
type
is also required by its propDefinition, consider:)type: { propDefinition: [ hubspot, "type", ], + optional: true, },
Please confirm whether the underlying propDefinitions already mark these optional.
37-48
: Treat advanced fields as optional
actions
andenrollmentCriteria
should be optional for PATCH-like behavior.actions: { propDefinition: [ hubspot, "actions", ], + optional: true, }, enrollmentCriteria: { propDefinition: [ hubspot, "enrollmentCriteria", ], + optional: true, },
56-63
: Prefer safe merge if PUT expects full resourceIf the endpoint requires full objects (common with PUT), merge required fields from the fetched workflow to avoid server-side validation errors.
async run({ $ }) { - const data = {}; + const data = {}; @@ - if (!this.revisionId) { - const workflow = await this.hubspot.getWorkflowDetails({ + if (!this.revisionId) { + const workflow = await this.hubspot.getWorkflowDetails({ workflowId: this.workflowId, }); - data.revisionId = workflow.revisionId + 1; + // Preserve required immutable fields if HubSpot expects full updates + if (workflow?.objectTypeId && !data.objectTypeId) data.objectTypeId = workflow.objectTypeId; + if (workflow?.flowType && !data.flowType) data.flowType = workflow.flowType; + data.revisionId = Number(workflow.revisionId) + 1;Please confirm whether PUT supports partial updates; if yes, the merge is unnecessary.
Also applies to: 64-71
73-77
: Add a single retry on 409 conflictConcurrent edits can cause revision conflicts. Retry once by refetching the latest revision.
- const response = await this.hubspot.updateWorkflow({ - workflowId: this.workflowId, - data, - $, - }); + let response; + try { + response = await this.hubspot.updateWorkflow({ workflowId: this.workflowId, data, $ }); + } catch (err) { + if (err?.response?.status === 409 && !this.revisionId) { + const latest = await this.hubspot.getWorkflowDetails({ workflowId: this.workflowId }); + data.revisionId = Number(latest.revisionId) + 1; + response = await this.hubspot.updateWorkflow({ workflowId: this.workflowId, data, $ }); + } else { + throw err; + } + }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (10)
components/hubspot/actions/create-workflow/create-workflow.mjs
(1 hunks)components/hubspot/actions/delete-workflow/delete-workflow.mjs
(1 hunks)components/hubspot/actions/retrieve-batch-workflows/retrieve-batch-workflows.mjs
(1 hunks)components/hubspot/actions/retrieve-migrated-workflow-mappings/retrieve-migrated-workflow-mappings.mjs
(1 hunks)components/hubspot/actions/retrieve-workflow-details/retrieve-workflow-details.mjs
(1 hunks)components/hubspot/actions/retrieve-workflow-emails/retrieve-workflow-emails.mjs
(1 hunks)components/hubspot/actions/retrieve-workflows/retrieve-workflows.mjs
(1 hunks)components/hubspot/actions/update-workflow/update-workflow.mjs
(1 hunks)components/hubspot/hubspot.app.mjs
(4 hunks)components/hubspot/package.json
(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (8)
components/hubspot/actions/retrieve-workflow-emails/retrieve-workflow-emails.mjs (3)
components/hubspot/actions/delete-workflow/delete-workflow.mjs (1)
response
(20-23)components/hubspot/actions/retrieve-workflow-details/retrieve-workflow-details.mjs (1)
response
(21-24)components/hubspot/actions/retrieve-workflows/retrieve-workflows.mjs (1)
response
(26-32)
components/hubspot/actions/retrieve-workflows/retrieve-workflows.mjs (2)
components/hubspot/actions/retrieve-workflow-emails/retrieve-workflow-emails.mjs (1)
response
(38-46)components/hubspot/hubspot.app.mjs (1)
response
(917-922)
components/hubspot/actions/delete-workflow/delete-workflow.mjs (3)
components/hubspot/actions/retrieve-workflow-details/retrieve-workflow-details.mjs (1)
response
(21-24)components/hubspot/actions/update-workflow/update-workflow.mjs (1)
response
(73-77)components/hubspot/actions/retrieve-batch-workflows/retrieve-batch-workflows.mjs (1)
response
(27-30)
components/hubspot/actions/update-workflow/update-workflow.mjs (3)
components/hubspot/actions/create-workflow/create-workflow.mjs (1)
response
(43-54)components/hubspot/actions/retrieve-workflow-details/retrieve-workflow-details.mjs (1)
response
(21-24)components/hubspot/actions/retrieve-batch-workflows/retrieve-batch-workflows.mjs (1)
response
(27-30)
components/hubspot/actions/retrieve-workflow-details/retrieve-workflow-details.mjs (2)
components/hubspot/actions/delete-workflow/delete-workflow.mjs (1)
response
(20-23)components/hubspot/actions/retrieve-batch-workflows/retrieve-batch-workflows.mjs (1)
response
(27-30)
components/hubspot/actions/retrieve-migrated-workflow-mappings/retrieve-migrated-workflow-mappings.mjs (5)
components/hubspot/actions/retrieve-batch-workflows/retrieve-batch-workflows.mjs (2)
parsedWorkflowIds
(24-24)response
(27-30)components/hubspot/actions/create-workflow/create-workflow.mjs (1)
response
(43-54)components/hubspot/actions/retrieve-workflow-emails/retrieve-workflow-emails.mjs (1)
response
(38-46)components/hubspot/actions/update-workflow/update-workflow.mjs (1)
response
(73-77)components/hubspot/hubspot.app.mjs (1)
response
(917-922)
components/hubspot/actions/retrieve-batch-workflows/retrieve-batch-workflows.mjs (2)
components/hubspot/actions/retrieve-migrated-workflow-mappings/retrieve-migrated-workflow-mappings.mjs (2)
parsedWorkflowIds
(27-27)response
(45-53)components/hubspot/actions/retrieve-workflow-details/retrieve-workflow-details.mjs (1)
response
(21-24)
components/hubspot/hubspot.app.mjs (1)
components/hubspot/common/constants.mjs (1)
API_PATH
(9-29)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: pnpm publish
- GitHub Check: Publish TypeScript components
- GitHub Check: Lint Code Base
- GitHub Check: Verify TypeScript components
🔇 Additional comments (14)
components/hubspot/package.json (1)
3-3
: Version bump looks good and matches added actions.
No further concerns from me on this file.components/hubspot/actions/retrieve-workflow-details/retrieve-workflow-details.mjs (1)
21-28
: LGTM — calls the right app method with the expected params.
The run implementation is straightforward and matches GET /automation/v4/flows/{flowId}. (developers.hubspot.com)components/hubspot/actions/retrieve-workflow-emails/retrieve-workflow-emails.mjs (1)
41-45
: Confirm whether flowId must be an array; wrap if necessary.
Docs define flowId as string[]. If the app client doesn’t normalize a single ID to an array, pass[this.workflowId]
to avoid 400s. (developers.hubspot.com)- flowId: this.workflowId, + flowId: Array.isArray(this.workflowId) ? this.workflowId : [this.workflowId],components/hubspot/actions/create-workflow/create-workflow.mjs (1)
42-58
: Double-check if startActionId/nextAvailableActionId are required by your client.
Docs examples include these fields in create payloads; some shapes infer them from actions, others require explicit IDs. Verify your hubspot.app.mjs method handles both cases. (developers.hubspot.com)components/hubspot/actions/retrieve-workflows/retrieve-workflows.mjs (1)
25-33
: LGTM — correct params for list endpoint (after, limit).
Matches the Automation v4 paging model. (developers.hubspot.com)components/hubspot/actions/delete-workflow/delete-workflow.mjs (2)
19-27
: LGTM: action wiring and summary.Deletion calls the right app method and exports a clear summary. Looks good.
6-6
: Update documentation URL
Replace the incorrect link in the description with the official v4 Workflows docs:- description: "Delete a workflow by ID. [See the documentation](https://developers.hubspot.com/docs/api-reference/automation-automation-v4-v4/workflows/delete-automation-v4-flows-flowId)" + description: "Delete a workflow by ID. [See the documentation](https://developers.hubspot.com/docs/api/automation/workflows)"components/hubspot/actions/retrieve-migrated-workflow-mappings/retrieve-migrated-workflow-mappings.mjs (1)
7-7
: No changes required for docs URL
The existing URL is correct and matches the official HubSpot documentation.Likely an incorrect or invalid review comment.
components/hubspot/actions/retrieve-batch-workflows/retrieve-batch-workflows.mjs (2)
7-7
: Update docs link to v4 workflow-id-mappings batch readReplace legacy v3 URL in the description at components/hubspot/actions/retrieve-batch-workflows/retrieve-batch-workflows.mjs:7 with the v4 batch read endpoint docs:
- description: "Retrieve multiple workflows by their IDs. [See the documentation](https://developers.hubspot.com/docs/api-reference/legacy/create-manage-workflows-v3/get-automation-v3-workflows)", + description: "Retrieve multiple workflows by their IDs. [See the documentation](https://developers.hubspot.com/docs/api-reference/automation-automation-v4-v4/workflow-id-mappings/post-automation-v4-workflow-id-mappings-batch-read)",
1-39
: No otherworkflowId
propDefinition instances found
Searched across the repo forpropDefinition: [hubspot, "workflowId"]
and confirmed this is the only occurrence.components/hubspot/hubspot.app.mjs (3)
346-354
: LGTM: workflow options now read from v4 list results.Mapping
{ name, id }
fromlistWorkflows()
to prop options looks correct.Also applies to: 341-356
1243-1245
: LGTM: migrated listWorkflows to v4 /flows.Correct API path.
1258-1309
: LGTM: new v4 workflow methods.
getWorkflowEmails
,getWorkflowDetails
,createWorkflow
,updateWorkflow
,deleteWorkflow
, andgetMigratedWorkflowMappings
are correctly wired to Automation v4.components/hubspot/actions/update-workflow/update-workflow.mjs (1)
61-61
: Good boolean handlingUsing
Object.hasOwn(this, "isEnabled")
correctly preserves falsey booleans.
components/hubspot/actions/retrieve-batch-workflows/retrieve-batch-workflows.mjs
Outdated
Show resolved
Hide resolved
components/hubspot/actions/retrieve-batch-workflows/retrieve-batch-workflows.mjs
Outdated
Show resolved
Hide resolved
.../hubspot/actions/retrieve-migrated-workflow-mappings/retrieve-migrated-workflow-mappings.mjs
Show resolved
Hide resolved
- Deleted the `retrieve-batch-workflows` action from HubSpot components as part of the ongoing refactor to streamline workflow management actions. - Updated the `update-workflow` action to change the `revisionId` type from string to integer for better data integrity.
- Bumped version numbers for multiple HubSpot actions and sources to reflect recent updates and improvements. - Actions updated include: add-contact-to-list, batch-create-companies, batch-update-companies, create-associations, create-communication, and more. - Sources updated include: new-company-property-change, new-contact-property-change, new-deal-property-change, and others. - Ensured consistency across versioning for better management and tracking of changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
components/hubspot/actions/get-associated-emails/get-associated-emails.mjs (1)
71-74
: Fix falsey check and potential crash when no emailsOperator precedence makes the condition always evaluate unexpectedly, and emails can be undefined leading to a runtime error when accessing length. Default results to [] and fix the condition.
- if (!results?.length > 0) { + if (!(results?.length > 0)) { $.export("$summary", "No emails found with this association"); return []; } @@ - const { results: emails } = await this.hubspot.batchGetObjects({ + const { results: emails = [] } = await this.hubspot.batchGetObjects({ $, objectType: "emails", data: { properties, inputs: emailIds, }, }); @@ - const summary = `Successfully retrieved ${emails.length} email(s)`; + const summary = `Successfully retrieved ${emails.length} email(s)`;Also applies to: 80-87, 96-100
components/hubspot/actions/list-marketing-events/list-marketing-events.mjs (1)
20-25
: Fix variable shadowing and self-append bug in pagination loopYou’re pushing into the same array you’re iterating (inner
results
) and shadowing the outer accumulator, which can lead to duplicate items and unpredictable loops. Also guard optional chaining onpaging.next
.- const results = []; + const allResults = []; @@ - const { - paging, results, - } = await this.hubspot.listMarketingEvents({ + const { paging, results: pageResults } = await this.hubspot.listMarketingEvents({ $, params, }); - if (!results?.length) { + if (!pageResults?.length) { break; } - for (const item of results) { - results.push(item); + for (const item of pageResults) { + allResults.push(item); count++; if (count >= this.maxResults) { break; } } - hasMore = paging?.next.after; - params.after = paging?.next.after; + hasMore = paging?.next?.after; + params.after = paging?.next?.after; } while (hasMore && count < this.maxResults); @@ - $.export("$summary", `Found ${results.length} event${results.length === 1 + $.export("$summary", `Found ${allResults.length} event${allResults.length === 1 ? "" : "s"}`); - return results; + return allResults;Also applies to: 27-33, 36-45, 47-51
♻️ Duplicate comments (2)
components/hubspot/actions/update-workflow/update-workflow.mjs (2)
7-7
: Fix broken documentation URLPoint to the canonical Workflows “Update a workflow” docs.
- description: "Update an existing workflow. [See the documentation](https://developers.hubspot.com/docs/api-reference/automation-automation-v4-v4/workflows/put-automation-v4-flows-flowId)", + description: "Update an existing workflow. [See the documentation](https://developers.hubspot.com/docs/reference/api/automation/create-manage-workflows#update-a-workflow)",
64-71
: Use the current revisionId (do not client-side increment)
The API requires therevisionId
to exactly match the latest revision returned by GET; the server will handle bumping on update (developers.hubspot.com). Remove the+1
and always coerce to a number:- if (!this.revisionId) { - const workflow = await this.hubspot.getWorkflowDetails({ workflowId: this.workflowId }); - data.revisionId = workflow.revisionId + 1; - } else { - data.revisionId = this.revisionId; - } + if (!this.revisionId) { + const workflow = await this.hubspot.getWorkflowDetails({ workflowId: this.workflowId }); + data.revisionId = Number(workflow.revisionId); + } else { + data.revisionId = Number(this.revisionId); + }
🧹 Nitpick comments (1)
components/hubspot/actions/get-associated-emails/get-associated-emails.mjs (1)
23-34
: Nit: avoid mixing explicit props with propDefinitionDefining type/label/description alongside a propDefinition can be redundant or overridden by the shared definition. Consider relying solely on the propDefinition metadata for consistency.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (74)
components/hubspot/actions/add-contact-to-list/add-contact-to-list.mjs
(1 hunks)components/hubspot/actions/batch-create-companies/batch-create-companies.mjs
(1 hunks)components/hubspot/actions/batch-create-or-update-contact/batch-create-or-update-contact.mjs
(1 hunks)components/hubspot/actions/batch-update-companies/batch-update-companies.mjs
(1 hunks)components/hubspot/actions/batch-upsert-companies/batch-upsert-companies.mjs
(1 hunks)components/hubspot/actions/clone-email/clone-email.mjs
(1 hunks)components/hubspot/actions/clone-site-page/clone-site-page.mjs
(1 hunks)components/hubspot/actions/create-associations/create-associations.mjs
(1 hunks)components/hubspot/actions/create-communication/create-communication.mjs
(1 hunks)components/hubspot/actions/create-company/create-company.mjs
(1 hunks)components/hubspot/actions/create-contact-workflow/create-contact-workflow.mjs
(1 hunks)components/hubspot/actions/create-custom-object/create-custom-object.mjs
(1 hunks)components/hubspot/actions/create-deal/create-deal.mjs
(1 hunks)components/hubspot/actions/create-email/create-email.mjs
(1 hunks)components/hubspot/actions/create-engagement/create-engagement.mjs
(1 hunks)components/hubspot/actions/create-form/create-form.mjs
(1 hunks)components/hubspot/actions/create-landing-page/create-landing-page.mjs
(1 hunks)components/hubspot/actions/create-lead/create-lead.mjs
(1 hunks)components/hubspot/actions/create-meeting/create-meeting.mjs
(1 hunks)components/hubspot/actions/create-note/create-note.mjs
(1 hunks)components/hubspot/actions/create-or-update-contact/create-or-update-contact.mjs
(1 hunks)components/hubspot/actions/create-page/create-page.mjs
(1 hunks)components/hubspot/actions/create-task/create-task.mjs
(1 hunks)components/hubspot/actions/create-ticket/create-ticket.mjs
(1 hunks)components/hubspot/actions/enroll-contact-into-workflow/enroll-contact-into-workflow.mjs
(1 hunks)components/hubspot/actions/get-associated-emails/get-associated-emails.mjs
(1 hunks)components/hubspot/actions/get-associated-meetings/get-associated-meetings.mjs
(1 hunks)components/hubspot/actions/get-company/get-company.mjs
(1 hunks)components/hubspot/actions/get-contact/get-contact.mjs
(1 hunks)components/hubspot/actions/get-deal/get-deal.mjs
(1 hunks)components/hubspot/actions/get-file-public-url/get-file-public-url.mjs
(1 hunks)components/hubspot/actions/get-meeting/get-meeting.mjs
(1 hunks)components/hubspot/actions/get-subscription-preferences/get-subscription-preferences.mjs
(1 hunks)components/hubspot/actions/list-blog-posts/list-blog-posts.mjs
(1 hunks)components/hubspot/actions/list-campaigns/list-campaigns.mjs
(1 hunks)components/hubspot/actions/list-forms/list-forms.mjs
(1 hunks)components/hubspot/actions/list-marketing-emails/list-marketing-emails.mjs
(1 hunks)components/hubspot/actions/list-marketing-events/list-marketing-events.mjs
(1 hunks)components/hubspot/actions/list-pages/list-pages.mjs
(1 hunks)components/hubspot/actions/list-templates/list-templates.mjs
(1 hunks)components/hubspot/actions/search-crm/search-crm.mjs
(1 hunks)components/hubspot/actions/update-company/update-company.mjs
(1 hunks)components/hubspot/actions/update-contact/update-contact.mjs
(1 hunks)components/hubspot/actions/update-custom-object/update-custom-object.mjs
(1 hunks)components/hubspot/actions/update-deal/update-deal.mjs
(1 hunks)components/hubspot/actions/update-fields-on-the-form/update-fields-on-the-form.mjs
(1 hunks)components/hubspot/actions/update-landing-page/update-landing-page.mjs
(1 hunks)components/hubspot/actions/update-lead/update-lead.mjs
(1 hunks)components/hubspot/actions/update-page/update-page.mjs
(1 hunks)components/hubspot/actions/update-workflow/update-workflow.mjs
(1 hunks)components/hubspot/sources/delete-blog-article/delete-blog-article.mjs
(1 hunks)components/hubspot/sources/new-company-property-change/new-company-property-change.mjs
(1 hunks)components/hubspot/sources/new-contact-property-change/new-contact-property-change.mjs
(1 hunks)components/hubspot/sources/new-custom-object-property-change/new-custom-object-property-change.mjs
(1 hunks)components/hubspot/sources/new-deal-in-stage/new-deal-in-stage.mjs
(1 hunks)components/hubspot/sources/new-deal-property-change/new-deal-property-change.mjs
(1 hunks)components/hubspot/sources/new-email-event/new-email-event.mjs
(1 hunks)components/hubspot/sources/new-email-subscriptions-timeline/new-email-subscriptions-timeline.mjs
(1 hunks)components/hubspot/sources/new-engagement/new-engagement.mjs
(1 hunks)components/hubspot/sources/new-event/new-event.mjs
(1 hunks)components/hubspot/sources/new-form-submission/new-form-submission.mjs
(1 hunks)components/hubspot/sources/new-note/new-note.mjs
(1 hunks)components/hubspot/sources/new-or-updated-blog-article/new-or-updated-blog-article.mjs
(1 hunks)components/hubspot/sources/new-or-updated-company/new-or-updated-company.mjs
(1 hunks)components/hubspot/sources/new-or-updated-contact/new-or-updated-contact.mjs
(1 hunks)components/hubspot/sources/new-or-updated-crm-object/new-or-updated-crm-object.mjs
(1 hunks)components/hubspot/sources/new-or-updated-custom-object/new-or-updated-custom-object.mjs
(1 hunks)components/hubspot/sources/new-or-updated-deal/new-or-updated-deal.mjs
(1 hunks)components/hubspot/sources/new-or-updated-line-item/new-or-updated-line-item.mjs
(1 hunks)components/hubspot/sources/new-or-updated-product/new-or-updated-product.mjs
(1 hunks)components/hubspot/sources/new-social-media-message/new-social-media-message.mjs
(1 hunks)components/hubspot/sources/new-task/new-task.mjs
(1 hunks)components/hubspot/sources/new-ticket-property-change/new-ticket-property-change.mjs
(1 hunks)components/hubspot/sources/new-ticket/new-ticket.mjs
(1 hunks)
✅ Files skipped from review due to trivial changes (69)
- components/hubspot/actions/update-lead/update-lead.mjs
- components/hubspot/actions/create-custom-object/create-custom-object.mjs
- components/hubspot/actions/get-deal/get-deal.mjs
- components/hubspot/sources/new-company-property-change/new-company-property-change.mjs
- components/hubspot/sources/delete-blog-article/delete-blog-article.mjs
- components/hubspot/actions/update-page/update-page.mjs
- components/hubspot/sources/new-or-updated-contact/new-or-updated-contact.mjs
- components/hubspot/sources/new-task/new-task.mjs
- components/hubspot/actions/get-associated-meetings/get-associated-meetings.mjs
- components/hubspot/actions/create-landing-page/create-landing-page.mjs
- components/hubspot/actions/create-form/create-form.mjs
- components/hubspot/actions/update-company/update-company.mjs
- components/hubspot/sources/new-or-updated-blog-article/new-or-updated-blog-article.mjs
- components/hubspot/sources/new-or-updated-crm-object/new-or-updated-crm-object.mjs
- components/hubspot/actions/create-lead/create-lead.mjs
- components/hubspot/actions/get-company/get-company.mjs
- components/hubspot/sources/new-or-updated-line-item/new-or-updated-line-item.mjs
- components/hubspot/actions/search-crm/search-crm.mjs
- components/hubspot/actions/create-company/create-company.mjs
- components/hubspot/sources/new-or-updated-custom-object/new-or-updated-custom-object.mjs
- components/hubspot/sources/new-form-submission/new-form-submission.mjs
- components/hubspot/actions/create-meeting/create-meeting.mjs
- components/hubspot/sources/new-or-updated-company/new-or-updated-company.mjs
- components/hubspot/actions/batch-create-or-update-contact/batch-create-or-update-contact.mjs
- components/hubspot/actions/create-engagement/create-engagement.mjs
- components/hubspot/actions/update-landing-page/update-landing-page.mjs
- components/hubspot/actions/get-file-public-url/get-file-public-url.mjs
- components/hubspot/actions/add-contact-to-list/add-contact-to-list.mjs
- components/hubspot/actions/list-forms/list-forms.mjs
- components/hubspot/actions/update-fields-on-the-form/update-fields-on-the-form.mjs
- components/hubspot/sources/new-ticket-property-change/new-ticket-property-change.mjs
- components/hubspot/actions/batch-upsert-companies/batch-upsert-companies.mjs
- components/hubspot/sources/new-social-media-message/new-social-media-message.mjs
- components/hubspot/sources/new-deal-property-change/new-deal-property-change.mjs
- components/hubspot/actions/get-contact/get-contact.mjs
- components/hubspot/actions/get-subscription-preferences/get-subscription-preferences.mjs
- components/hubspot/actions/update-custom-object/update-custom-object.mjs
- components/hubspot/actions/update-contact/update-contact.mjs
- components/hubspot/actions/clone-email/clone-email.mjs
- components/hubspot/actions/create-email/create-email.mjs
- components/hubspot/actions/batch-create-companies/batch-create-companies.mjs
- components/hubspot/actions/clone-site-page/clone-site-page.mjs
- components/hubspot/sources/new-or-updated-product/new-or-updated-product.mjs
- components/hubspot/actions/list-blog-posts/list-blog-posts.mjs
- components/hubspot/actions/list-campaigns/list-campaigns.mjs
- components/hubspot/sources/new-or-updated-deal/new-or-updated-deal.mjs
- components/hubspot/actions/list-marketing-emails/list-marketing-emails.mjs
- components/hubspot/actions/list-templates/list-templates.mjs
- components/hubspot/sources/new-email-subscriptions-timeline/new-email-subscriptions-timeline.mjs
- components/hubspot/sources/new-deal-in-stage/new-deal-in-stage.mjs
- components/hubspot/actions/list-pages/list-pages.mjs
- components/hubspot/actions/create-task/create-task.mjs
- components/hubspot/actions/create-communication/create-communication.mjs
- components/hubspot/actions/create-or-update-contact/create-or-update-contact.mjs
- components/hubspot/actions/create-associations/create-associations.mjs
- components/hubspot/sources/new-custom-object-property-change/new-custom-object-property-change.mjs
- components/hubspot/sources/new-note/new-note.mjs
- components/hubspot/actions/create-note/create-note.mjs
- components/hubspot/sources/new-contact-property-change/new-contact-property-change.mjs
- components/hubspot/sources/new-event/new-event.mjs
- components/hubspot/sources/new-email-event/new-email-event.mjs
- components/hubspot/actions/create-deal/create-deal.mjs
- components/hubspot/actions/create-contact-workflow/create-contact-workflow.mjs
- components/hubspot/sources/new-engagement/new-engagement.mjs
- components/hubspot/actions/enroll-contact-into-workflow/enroll-contact-into-workflow.mjs
- components/hubspot/actions/create-ticket/create-ticket.mjs
- components/hubspot/actions/batch-update-companies/batch-update-companies.mjs
- components/hubspot/actions/get-meeting/get-meeting.mjs
- components/hubspot/sources/new-ticket/new-ticket.mjs
🧰 Additional context used
🧬 Code graph analysis (1)
components/hubspot/actions/update-workflow/update-workflow.mjs (3)
components/hubspot/actions/retrieve-workflow-details/retrieve-workflow-details.mjs (1)
response
(21-24)components/hubspot/actions/create-workflow/create-workflow.mjs (1)
response
(43-54)components/hubspot/actions/delete-workflow/delete-workflow.mjs (1)
response
(20-23)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Publish TypeScript components
- GitHub Check: Verify TypeScript components
- GitHub Check: Lint Code Base
🔇 Additional comments (3)
components/hubspot/actions/update-deal/update-deal.mjs (1)
10-10
: LGTM on version bumpNo functional changes; safe to publish.
components/hubspot/actions/create-page/create-page.mjs (1)
9-9
: LGTM on version bumpNo behavior changes; action remains consistent.
components/hubspot/actions/update-workflow/update-workflow.mjs (1)
57-63
: Include full workflow spec in PUT to prevent field loss
HubSpot’s workflows update endpoint uses PUT, which fully replaces the resource. Fetch the existing workflow via GET/automation/v3/workflows/{workflowId}
, merge all top-level properties (name, type, isEnabled, flowType, objectTypeId, startActionId, nextAvailableActionId, actions, enrollmentCriteria, etc.) with your updates, and send the complete payload. Applies to lines 57–63 and 73–79. (developers.hubspot.com)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @luancazarine lgtm! I've just added two suggestions for propDefition in the meantime let's move to Ready for QA!
.../hubspot/actions/retrieve-migrated-workflow-mappings/retrieve-migrated-workflow-mappings.mjs
Outdated
Show resolved
Hide resolved
- Updated workflow-related actions to utilize the v3 API instead of v4. - Renamed variables for clarity and consistency. - Removed deprecated props from create and update workflow actions. - Adjusted descriptions in action components to reflect the new API documentation. - Bumped versions for several source components to maintain compatibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
♻️ Duplicate comments (2)
components/hubspot/hubspot.app.mjs (1)
680-704
: Update documentation links to the correct HubSpot API guides.The documentation links for the
actions
field contains an incorrect URL pattern with "automation-automation-v4-v4". This appears to be a URL formatting issue.Apply this diff to fix the documentation link:
- description: "A list of objects representing the workflow actions. [See the documentation](https://developers.hubspot.com/docs/api-reference/automation-automation-v4-v4/guide#action-types) for more information.", + description: "A list of objects representing the workflow actions. [See the documentation](https://developers.hubspot.com/docs/api/automation/workflows#action-types) for more information.",components/hubspot/actions/retrieve-migrated-workflow-mappings/retrieve-migrated-workflow-mappings.mjs (1)
46-57
: Request payload uses wrong keys for batch mapping.The payload objects use incorrect keys (
flowMigrationStatuses
andflowMigrationStatusForClassicWorkflows
) which appear to be response field names rather than request field names. According to HubSpot's batch read API pattern, the expected format should be{ id, type }
.Apply this diff to build the correct inputs:
- const flowIds = []; - const workflowIds = []; - - for (const flowId of parsedFlowIds) { - flowIds.push({ - flowMigrationStatuses: `${flowId}`, - type: "FLOW_ID", - }); - } - for (const workflowId of parsedWorkflowIds) { - workflowIds.push({ - flowMigrationStatusForClassicWorkflows: `${workflowId}`, - type: "WORKFLOW_ID", - }); - } + const inputs = [ + ...parsedFlowIds.filter(Boolean).map((id) => ({ id: String(id), type: "FLOW_ID" })), + ...parsedWorkflowIds.filter(Boolean).map((id) => ({ id: String(id), type: "WORKFLOW_ID" })), + ]; + + if (!inputs.length) { + $.export("$summary", "No IDs provided"); + return { results: [], errors: [] }; + }And update the API call:
const response = await this.hubspot.getMigratedWorkflowMappings({ $, data: { - inputs: [ - ...flowIds, - ...workflowIds, - ], + inputs, }, });
🧹 Nitpick comments (15)
components/hubspot/sources/new-or-updated-line-item/new-or-updated-line-item.mjs (1)
12-12
: Fix brand capitalization and tighten phrasing.Prefer “HubSpot” and simpler wording.
- description: "Emit new event for each new line item added or updated in Hubspot.", + description: "Emit a new event when a line item is created or updated in HubSpot.",components/hubspot/sources/new-or-updated-crm-object/new-or-updated-crm-object.mjs (1)
9-9
: Minor grammar: add missing article.- description: "Emit new event each time a CRM Object of the specified object type is updated.", + description: "Emit a new event each time a CRM Object of the specified object type is updated.",components/hubspot/sources/new-contact-property-change/new-contact-property-change.mjs (1)
9-9
: Minor grammar: add missing article.- description: "Emit new event when a specified property is provided or updated on a contact. [See the documentation](https://developers.hubspot.com/docs/api/crm/contacts)", + description: "Emit a new event when a specified property is provided or updated on a contact. [See the documentation](https://developers.hubspot.com/docs/api/crm/contacts)",components/hubspot/sources/new-deal-property-change/new-deal-property-change.mjs (1)
9-9
: Minor grammar: add missing article.- description: "Emit new event when a specified property is provided or updated on a deal. [See the documentation](https://developers.hubspot.com/docs/api/crm/deals)", + description: "Emit a new event when a specified property is provided or updated on a deal. [See the documentation](https://developers.hubspot.com/docs/api/crm/deals)",components/hubspot/sources/new-company-property-change/new-company-property-change.mjs (1)
9-9
: Minor grammar: add missing article.- description: "Emit new event when a specified property is provided or updated on a company. [See the documentation](https://developers.hubspot.com/docs/api/crm/companies)", + description: "Emit a new event when a specified property is provided or updated on a company. [See the documentation](https://developers.hubspot.com/docs/api/crm/companies)",components/hubspot/sources/new-or-updated-custom-object/new-or-updated-custom-object.mjs (1)
9-9
: Minor grammar: add missing article.- description: "Emit new event each time a Custom Object of the specified schema is updated.", + description: "Emit a new event each time a Custom Object of the specified schema is updated.",components/hubspot/sources/new-engagement/new-engagement.mjs (1)
10-10
: Tighten wording and fix punctuation; add thousands separator.- description: "Emit new event for each new engagement created. This action returns a maximum of 5000 records at a time, make sure you set a correct time range so you don't miss any events", + description: "Emit a new event for each engagement created. Returns up to 5,000 records per request; set an appropriate time range to avoid missing events.",components/hubspot/sources/new-event/new-event.mjs (1)
10-10
: Capitalize “HubSpot” and tighten phrasing in description.
Minor copy nit to match brand capitalization and read smoothly.- description: "Emit new event for each new Hubspot event. Note: Only available for Marketing Hub Enterprise, Sales Hub Enterprise, Service Hub Enterprise, or CMS Hub Enterprise accounts", + description: "Emit an event for each new HubSpot event. Note: Only available for Marketing Hub Enterprise, Sales Hub Enterprise, Service Hub Enterprise, or CMS Hub Enterprise accounts",components/hubspot/sources/new-email-subscriptions-timeline/new-email-subscriptions-timeline.mjs (1)
8-8
: Polish description grammar.
Reads more naturally; no behavioral change.- description: "Emit new event when a new email timeline subscription is added for the portal.", + description: "Emit a new event when a new email timeline subscription is added to the portal.",components/hubspot/common/constants.mjs (1)
23-24
: Document legacy v3 Automation API
In components/hubspot/common/constants.mjs, annotate AUTOMATIONV3 to explain its usage and status:AUTOMATION: "/automation/v2", + // Legacy Workflows API (v3) — used for listing, creating, and deleting workflows. + // Still supported with no published deprecation date; monitor HubSpot docs and migrate to v4 when feasible. AUTOMATIONV3: "/automation/v3", AUTOMATIONV4: "/automation/v4",components/hubspot/actions/retrieve-workflows/retrieve-workflows.mjs (2)
17-18
: Guard summary against undefined results.
Avoids a crash ifresults
is absent.- $.export("$summary", `Successfully retrieved ${response.results.length} workflows`); + $.export("$summary", `Successfully retrieved ${response.results?.length ?? 0} workflows`);
12-15
: Expose pagination parameters
Add optionalafter
andlimit
props to the action’srun
signature and forward them inthis.hubspot.listWorkflows({ $, after, limit })
to enable pagination support for larger tenants.components/hubspot/actions/create-workflow/create-workflow.mjs (2)
12-16
: Mark required prop explicitly.
Makename
mandatory at the schema level.name: { type: "string", label: "Workflow Name", description: "The name of the workflow to create", + optional: false, },
31-38
: Optional: validate parsed actions shape before request.
IfparseObject
can return non-object/empty, add a quick type check to fail fast with a clear message.const response = await this.hubspot.createWorkflow({ data: { name: this.name, type: this.type, - actions: parseObject(this.actions), + actions: (() => { + const a = parseObject(this.actions); + if (!a || typeof a !== "object") throw new Error("Invalid actions payload"); + return a; + })(), }, $, });components/hubspot/actions/retrieve-workflow-details/retrieve-workflow-details.mjs (1)
26-27
: Enrich summary with workflow name when available.
Improves UX without changing behavior.- $.export("$summary", `Successfully retrieved details for workflow ${this.workflowId}`); + $.export("$summary", `Successfully retrieved details for workflow ${this.workflowId}${response?.name ? ` (${response.name})` : ""}`);
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (19)
components/hubspot/actions/batch-upsert-companies/batch-upsert-companies.mjs
(1 hunks)components/hubspot/actions/create-workflow/create-workflow.mjs
(1 hunks)components/hubspot/actions/delete-workflow/delete-workflow.mjs
(1 hunks)components/hubspot/actions/retrieve-migrated-workflow-mappings/retrieve-migrated-workflow-mappings.mjs
(1 hunks)components/hubspot/actions/retrieve-workflow-details/retrieve-workflow-details.mjs
(1 hunks)components/hubspot/actions/retrieve-workflow-emails/retrieve-workflow-emails.mjs
(1 hunks)components/hubspot/actions/retrieve-workflows/retrieve-workflows.mjs
(1 hunks)components/hubspot/common/constants.mjs
(1 hunks)components/hubspot/hubspot.app.mjs
(4 hunks)components/hubspot/sources/new-company-property-change/new-company-property-change.mjs
(1 hunks)components/hubspot/sources/new-contact-property-change/new-contact-property-change.mjs
(1 hunks)components/hubspot/sources/new-deal-property-change/new-deal-property-change.mjs
(1 hunks)components/hubspot/sources/new-email-subscriptions-timeline/new-email-subscriptions-timeline.mjs
(1 hunks)components/hubspot/sources/new-engagement/new-engagement.mjs
(1 hunks)components/hubspot/sources/new-event/new-event.mjs
(1 hunks)components/hubspot/sources/new-or-updated-crm-object/new-or-updated-crm-object.mjs
(1 hunks)components/hubspot/sources/new-or-updated-custom-object/new-or-updated-custom-object.mjs
(1 hunks)components/hubspot/sources/new-or-updated-line-item/new-or-updated-line-item.mjs
(1 hunks)components/xano_metadata_api/xano_metadata_api.app.mjs
(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (7)
components/hubspot/actions/delete-workflow/delete-workflow.mjs (5)
components/hubspot/actions/create-workflow/create-workflow.mjs (1)
response
(31-38)components/hubspot/actions/retrieve-migrated-workflow-mappings/retrieve-migrated-workflow-mappings.mjs (1)
response
(59-67)components/hubspot/actions/retrieve-workflow-details/retrieve-workflow-details.mjs (1)
response
(21-24)components/hubspot/actions/retrieve-workflows/retrieve-workflows.mjs (1)
response
(13-15)components/hubspot/actions/retrieve-workflow-emails/retrieve-workflow-emails.mjs (1)
response
(38-46)
components/hubspot/actions/retrieve-workflow-emails/retrieve-workflow-emails.mjs (6)
components/hubspot/hubspot.app.mjs (3)
response
(911-916)response
(1344-1348)response
(1370-1375)components/hubspot/actions/create-workflow/create-workflow.mjs (1)
response
(31-38)components/hubspot/actions/delete-workflow/delete-workflow.mjs (1)
response
(20-23)components/hubspot/actions/retrieve-migrated-workflow-mappings/retrieve-migrated-workflow-mappings.mjs (1)
response
(59-67)components/hubspot/actions/retrieve-workflow-details/retrieve-workflow-details.mjs (1)
response
(21-24)components/hubspot/actions/retrieve-workflows/retrieve-workflows.mjs (1)
response
(13-15)
components/hubspot/actions/create-workflow/create-workflow.mjs (4)
components/hubspot/hubspot.app.mjs (3)
response
(911-916)response
(1344-1348)response
(1370-1375)components/hubspot/actions/delete-workflow/delete-workflow.mjs (1)
response
(20-23)components/hubspot/actions/retrieve-workflow-details/retrieve-workflow-details.mjs (1)
response
(21-24)components/hubspot/actions/retrieve-workflows/retrieve-workflows.mjs (1)
response
(13-15)
components/hubspot/actions/retrieve-workflows/retrieve-workflows.mjs (6)
components/hubspot/hubspot.app.mjs (3)
response
(911-916)response
(1344-1348)response
(1370-1375)components/hubspot/actions/create-workflow/create-workflow.mjs (1)
response
(31-38)components/hubspot/actions/delete-workflow/delete-workflow.mjs (1)
response
(20-23)components/hubspot/actions/retrieve-migrated-workflow-mappings/retrieve-migrated-workflow-mappings.mjs (1)
response
(59-67)components/hubspot/actions/retrieve-workflow-details/retrieve-workflow-details.mjs (1)
response
(21-24)components/hubspot/actions/retrieve-workflow-emails/retrieve-workflow-emails.mjs (1)
response
(38-46)
components/hubspot/actions/retrieve-migrated-workflow-mappings/retrieve-migrated-workflow-mappings.mjs (3)
components/hubspot/hubspot.app.mjs (3)
response
(911-916)response
(1344-1348)response
(1370-1375)components/hubspot/actions/create-workflow/create-workflow.mjs (1)
response
(31-38)components/hubspot/actions/retrieve-workflow-emails/retrieve-workflow-emails.mjs (1)
response
(38-46)
components/hubspot/actions/retrieve-workflow-details/retrieve-workflow-details.mjs (5)
components/hubspot/actions/create-workflow/create-workflow.mjs (1)
response
(31-38)components/hubspot/actions/delete-workflow/delete-workflow.mjs (1)
response
(20-23)components/hubspot/actions/retrieve-migrated-workflow-mappings/retrieve-migrated-workflow-mappings.mjs (1)
response
(59-67)components/hubspot/actions/retrieve-workflows/retrieve-workflows.mjs (1)
response
(13-15)components/hubspot/actions/retrieve-workflow-emails/retrieve-workflow-emails.mjs (1)
response
(38-46)
components/hubspot/hubspot.app.mjs (1)
components/hubspot/common/constants.mjs (1)
API_PATH
(9-30)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: pnpm publish
- GitHub Check: Lint Code Base
- GitHub Check: Verify TypeScript components
- GitHub Check: Publish TypeScript components
🔇 Additional comments (5)
components/xano_metadata_api/xano_metadata_api.app.mjs (1)
11-11
: Trailing newline added — OK.components/hubspot/actions/delete-workflow/delete-workflow.mjs (1)
3-28
: LGTM.
Action wiring and summary look consistent with the new app methods.components/hubspot/hubspot.app.mjs (3)
1237-1237
: Good use of bracket notation for property access.Using bracket notation for
API_PATH["AUTOMATIONV3"]
ensures compatibility when the property name matches a reserved word or contains special characters. This is a good defensive programming practice.
1252-1258
: LGTM! Clean implementation of getWorkflowEmails.The method correctly uses the AUTOMATIONV4 API path and follows the established pattern for API methods in this file.
1259-1293
: Well-structured workflow management methods.The new workflow methods (
getWorkflowDetails
,createWorkflow
,deleteWorkflow
,getMigratedWorkflowMappings
) are properly implemented with:
- Consistent use of AUTOMATIONV3 API path
- Appropriate HTTP methods
- Clear parameter destructuring
- Consistent error handling through the base
makeRequest
method
components/hubspot/actions/batch-upsert-companies/batch-upsert-companies.mjs
Show resolved
Hide resolved
.../hubspot/actions/retrieve-migrated-workflow-mappings/retrieve-migrated-workflow-mappings.mjs
Show resolved
Hide resolved
components/hubspot/actions/retrieve-workflow-emails/retrieve-workflow-emails.mjs
Show resolved
Hide resolved
…maintain compatibility with the latest API changes.
…ibility with the latest API changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
components/hubspot/actions/list-blog-posts/list-blog-posts.mjs (1)
82-85
: Fix shadowed variable + self-appending loop (returns empty list or duplicates).
- The outer accumulator
results
is shadowed by the destructuredresults
from the API response.- Inside the loop, you push into the same array you’re iterating (
results.push(item)
while iteratingfor (const item of results)
), which can grow during iteration and duplicate entries.- Summary/return also reference the (empty) outer
results
.Apply the following corrections:
- const results = []; + const allPosts = []; @@ - const { - paging, results, - } = await this.hubspot.getBlogPosts({ + const { + paging, results: pageResults, + } = await this.hubspot.getBlogPosts({ $, params, }); - if (!results?.length) { + if (!pageResults?.length) { break; } - for (const item of results) { - results.push(item); + for (const item of pageResults) { + allPosts.push(item); count++; if (count >= this.maxResults) { break; } } - hasMore = paging?.next.after; - params.after = paging?.next.after; + const after = paging?.next?.after; + hasMore = Boolean(after); + if (after) params.after = after; } while (hasMore && count < this.maxResults); - $.export( - "$summary", - `Found ${results.length} page${results.length === 1 - ? "" - : "s"}`, - ); - return results; + $.export( + "$summary", + `Found ${allPosts.length} blog post${allPosts.length === 1 ? "" : "s"}`, + ); + return allPosts;Also applies to: 97-105, 107-116, 118-125
components/hubspot/actions/get-associated-meetings/get-associated-meetings.mjs (1)
203-212
: Bug: custom timeframe operators are inverted (returns meetings outside the range)For a custom window, start should be GTE and end should be LTE. Current logic flips them.
Apply this diff:
case "custom": return { hs_meeting_start_time: { - operator: "LTE", + operator: "GTE", value: startDate, }, hs_meeting_end_time: { - operator: "GTE", + operator: "LTE", value: endDate, }, };
🧹 Nitpick comments (3)
components/hubspot/actions/create-ticket/create-ticket.mjs (1)
8-9
: Brand capitalization: “HubSpot”.Minor copy nit: update “Hubspot” → “HubSpot” in the description.
- description: - "Create a ticket in Hubspot. [See the documentation](https://developers.hubspot.com/docs/api/crm/tickets)", + description: + "Create a ticket in HubSpot. [See the documentation](https://developers.hubspot.com/docs/api/crm/tickets)",components/hubspot/actions/list-blog-posts/list-blog-posts.mjs (1)
55-59
: Clarify “Archived” description.“Specifies whether to return deleted Blog Posts” is ambiguous. Suggest: “Include archived (soft-deleted) blog posts.”
- description: "Specifies whether to return deleted Blog Posts", + description: "Include archived (soft-deleted) blog posts",components/hubspot/actions/get-associated-meetings/get-associated-meetings.mjs (1)
63-68
: Require dates when timeframe is custom to avoid invalid payloadsMake
startDate
/endDate
required in the UI whentimeframe === "custom"
.Apply this diff:
startDate: { type: "string", label: "Start Date", description: "The start date to filter meetings from (ISO 8601 format). Eg. `2025-01-01T00:00:00Z`", + optional: false, }, endDate: { type: "string", label: "End Date", description: "The end date to filter meetings to (ISO 8601 format). Eg. `2025-01-31T23:59:59Z`", + optional: false, },Optionally, also guard at runtime:
const meetings = await this.getAssociatedMeetings({ objectType: this.objectType, objectId: resolvedObjectId, - timeframe: this.timeframe, + timeframe: this.timeframe, startDate: this.startDate, endDate: this.endDate, mostRecent: this.mostRecent, });(Inside getAssociatedMeetings or before calling it:)
+ if (this.timeframe === "custom" && (!this.startDate || !this.endDate)) { + throw new Error("Start Date and End Date are required when timeframe is set to custom."); + }Also applies to: 69-74
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (64)
components/hubspot/actions/add-contact-to-list/add-contact-to-list.mjs
(1 hunks)components/hubspot/actions/batch-create-companies/batch-create-companies.mjs
(1 hunks)components/hubspot/actions/batch-create-or-update-contact/batch-create-or-update-contact.mjs
(1 hunks)components/hubspot/actions/batch-update-companies/batch-update-companies.mjs
(1 hunks)components/hubspot/actions/clone-email/clone-email.mjs
(1 hunks)components/hubspot/actions/clone-site-page/clone-site-page.mjs
(1 hunks)components/hubspot/actions/create-associations/create-associations.mjs
(1 hunks)components/hubspot/actions/create-communication/create-communication.mjs
(1 hunks)components/hubspot/actions/create-company/create-company.mjs
(1 hunks)components/hubspot/actions/create-contact-workflow/create-contact-workflow.mjs
(1 hunks)components/hubspot/actions/create-custom-object/create-custom-object.mjs
(1 hunks)components/hubspot/actions/create-deal/create-deal.mjs
(1 hunks)components/hubspot/actions/create-email/create-email.mjs
(1 hunks)components/hubspot/actions/create-engagement/create-engagement.mjs
(1 hunks)components/hubspot/actions/create-form/create-form.mjs
(1 hunks)components/hubspot/actions/create-landing-page/create-landing-page.mjs
(1 hunks)components/hubspot/actions/create-lead/create-lead.mjs
(1 hunks)components/hubspot/actions/create-meeting/create-meeting.mjs
(1 hunks)components/hubspot/actions/create-note/create-note.mjs
(1 hunks)components/hubspot/actions/create-or-update-contact/create-or-update-contact.mjs
(1 hunks)components/hubspot/actions/create-page/create-page.mjs
(1 hunks)components/hubspot/actions/create-task/create-task.mjs
(1 hunks)components/hubspot/actions/create-ticket/create-ticket.mjs
(1 hunks)components/hubspot/actions/enroll-contact-into-workflow/enroll-contact-into-workflow.mjs
(1 hunks)components/hubspot/actions/get-associated-emails/get-associated-emails.mjs
(1 hunks)components/hubspot/actions/get-associated-meetings/get-associated-meetings.mjs
(1 hunks)components/hubspot/actions/get-company/get-company.mjs
(1 hunks)components/hubspot/actions/get-contact/get-contact.mjs
(1 hunks)components/hubspot/actions/get-deal/get-deal.mjs
(1 hunks)components/hubspot/actions/get-file-public-url/get-file-public-url.mjs
(1 hunks)components/hubspot/actions/get-meeting/get-meeting.mjs
(1 hunks)components/hubspot/actions/get-subscription-preferences/get-subscription-preferences.mjs
(1 hunks)components/hubspot/actions/list-blog-posts/list-blog-posts.mjs
(1 hunks)components/hubspot/actions/list-campaigns/list-campaigns.mjs
(1 hunks)components/hubspot/actions/list-forms/list-forms.mjs
(1 hunks)components/hubspot/actions/list-marketing-emails/list-marketing-emails.mjs
(1 hunks)components/hubspot/actions/list-marketing-events/list-marketing-events.mjs
(1 hunks)components/hubspot/actions/list-pages/list-pages.mjs
(1 hunks)components/hubspot/actions/list-templates/list-templates.mjs
(1 hunks)components/hubspot/actions/search-crm/search-crm.mjs
(1 hunks)components/hubspot/actions/update-company/update-company.mjs
(1 hunks)components/hubspot/actions/update-contact/update-contact.mjs
(1 hunks)components/hubspot/actions/update-custom-object/update-custom-object.mjs
(1 hunks)components/hubspot/actions/update-deal/update-deal.mjs
(1 hunks)components/hubspot/actions/update-fields-on-the-form/update-fields-on-the-form.mjs
(1 hunks)components/hubspot/actions/update-landing-page/update-landing-page.mjs
(1 hunks)components/hubspot/actions/update-lead/update-lead.mjs
(1 hunks)components/hubspot/actions/update-page/update-page.mjs
(1 hunks)components/hubspot/sources/delete-blog-article/delete-blog-article.mjs
(1 hunks)components/hubspot/sources/new-contact-added-to-list/new-contact-added-to-list.mjs
(1 hunks)components/hubspot/sources/new-custom-object-property-change/new-custom-object-property-change.mjs
(1 hunks)components/hubspot/sources/new-deal-in-stage/new-deal-in-stage.mjs
(1 hunks)components/hubspot/sources/new-email-event/new-email-event.mjs
(1 hunks)components/hubspot/sources/new-form-submission/new-form-submission.mjs
(1 hunks)components/hubspot/sources/new-note/new-note.mjs
(1 hunks)components/hubspot/sources/new-or-updated-blog-article/new-or-updated-blog-article.mjs
(1 hunks)components/hubspot/sources/new-or-updated-company/new-or-updated-company.mjs
(1 hunks)components/hubspot/sources/new-or-updated-contact/new-or-updated-contact.mjs
(1 hunks)components/hubspot/sources/new-or-updated-deal/new-or-updated-deal.mjs
(1 hunks)components/hubspot/sources/new-or-updated-product/new-or-updated-product.mjs
(1 hunks)components/hubspot/sources/new-social-media-message/new-social-media-message.mjs
(1 hunks)components/hubspot/sources/new-task/new-task.mjs
(1 hunks)components/hubspot/sources/new-ticket-property-change/new-ticket-property-change.mjs
(1 hunks)components/hubspot/sources/new-ticket/new-ticket.mjs
(1 hunks)
✅ Files skipped from review due to trivial changes (59)
- components/hubspot/sources/new-ticket-property-change/new-ticket-property-change.mjs
- components/hubspot/actions/create-page/create-page.mjs
- components/hubspot/actions/create-engagement/create-engagement.mjs
- components/hubspot/sources/new-task/new-task.mjs
- components/hubspot/sources/new-email-event/new-email-event.mjs
- components/hubspot/actions/update-page/update-page.mjs
- components/hubspot/actions/create-task/create-task.mjs
- components/hubspot/actions/list-marketing-emails/list-marketing-emails.mjs
- components/hubspot/actions/create-associations/create-associations.mjs
- components/hubspot/actions/create-form/create-form.mjs
- components/hubspot/actions/create-meeting/create-meeting.mjs
- components/hubspot/actions/create-or-update-contact/create-or-update-contact.mjs
- components/hubspot/actions/batch-create-or-update-contact/batch-create-or-update-contact.mjs
- components/hubspot/actions/create-landing-page/create-landing-page.mjs
- components/hubspot/sources/new-form-submission/new-form-submission.mjs
- components/hubspot/sources/new-or-updated-deal/new-or-updated-deal.mjs
- components/hubspot/actions/update-deal/update-deal.mjs
- components/hubspot/actions/create-email/create-email.mjs
- components/hubspot/actions/search-crm/search-crm.mjs
- components/hubspot/actions/create-lead/create-lead.mjs
- components/hubspot/actions/get-deal/get-deal.mjs
- components/hubspot/actions/update-company/update-company.mjs
- components/hubspot/actions/create-custom-object/create-custom-object.mjs
- components/hubspot/actions/create-communication/create-communication.mjs
- components/hubspot/actions/batch-update-companies/batch-update-companies.mjs
- components/hubspot/actions/update-custom-object/update-custom-object.mjs
- components/hubspot/sources/new-or-updated-company/new-or-updated-company.mjs
- components/hubspot/sources/new-or-updated-blog-article/new-or-updated-blog-article.mjs
- components/hubspot/sources/new-or-updated-product/new-or-updated-product.mjs
- components/hubspot/actions/clone-site-page/clone-site-page.mjs
- components/hubspot/sources/new-social-media-message/new-social-media-message.mjs
- components/hubspot/sources/delete-blog-article/delete-blog-article.mjs
- components/hubspot/actions/get-contact/get-contact.mjs
- components/hubspot/actions/list-campaigns/list-campaigns.mjs
- components/hubspot/actions/update-lead/update-lead.mjs
- components/hubspot/actions/create-deal/create-deal.mjs
- components/hubspot/actions/create-note/create-note.mjs
- components/hubspot/sources/new-note/new-note.mjs
- components/hubspot/sources/new-deal-in-stage/new-deal-in-stage.mjs
- components/hubspot/actions/add-contact-to-list/add-contact-to-list.mjs
- components/hubspot/actions/list-forms/list-forms.mjs
- components/hubspot/actions/list-marketing-events/list-marketing-events.mjs
- components/hubspot/actions/update-fields-on-the-form/update-fields-on-the-form.mjs
- components/hubspot/actions/update-landing-page/update-landing-page.mjs
- components/hubspot/sources/new-ticket/new-ticket.mjs
- components/hubspot/actions/get-subscription-preferences/get-subscription-preferences.mjs
- components/hubspot/actions/update-contact/update-contact.mjs
- components/hubspot/actions/get-meeting/get-meeting.mjs
- components/hubspot/actions/create-contact-workflow/create-contact-workflow.mjs
- components/hubspot/actions/get-company/get-company.mjs
- components/hubspot/sources/new-or-updated-contact/new-or-updated-contact.mjs
- components/hubspot/actions/list-pages/list-pages.mjs
- components/hubspot/actions/clone-email/clone-email.mjs
- components/hubspot/sources/new-custom-object-property-change/new-custom-object-property-change.mjs
- components/hubspot/actions/get-file-public-url/get-file-public-url.mjs
- components/hubspot/actions/batch-create-companies/batch-create-companies.mjs
- components/hubspot/actions/enroll-contact-into-workflow/enroll-contact-into-workflow.mjs
- components/hubspot/actions/get-associated-emails/get-associated-emails.mjs
- components/hubspot/actions/list-templates/list-templates.mjs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: pnpm publish
- GitHub Check: Verify TypeScript components
- GitHub Check: Publish TypeScript components
- GitHub Check: Lint Code Base
🔇 Additional comments (8)
components/hubspot/actions/create-company/create-company.mjs (1)
10-10
: LGTM — patch version bump onlyNo logic or API surface change; safe to publish.
components/hubspot/actions/create-ticket/create-ticket.mjs (1)
10-10
: Patch bump only — OK.Version bump to 0.0.19 looks fine and non-breaking.
components/hubspot/sources/new-contact-added-to-list/new-contact-added-to-list.mjs (1)
15-15
: Version bump only — LGTMPatch bump to 0.0.2 with no logic changes. Safe to merge.
components/hubspot/actions/list-blog-posts/list-blog-posts.mjs (2)
8-8
: Version bump looks fine.No behavioral change here.
61-71
: Sort fields are valid: HubSpot CMS Blog Posts API supports name, createdAt, updatedAt, createdBy, and updatedBy as sort keys for GET /cms/v3/blogs/posts—no changes needed.Likely an incorrect or invalid review comment.
components/hubspot/actions/get-associated-meetings/get-associated-meetings.mjs (3)
10-10
: LGTM: version bump onlyNo functional changes in this file from this PR; version updated to 0.0.9.
116-139
: Week starts on Sunday (UTC) — confirm product expectation
this_week
computes Sunday–Saturday in UTC. If the desired business week is Monday–Sunday or local TZ, we should adjust or add a configurable option.If Monday-based weeks are desired, a simple fix:
- const dayOfWeek = now.getUTCDay(); + // Treat Monday as 0 + const dayOfWeek = (now.getUTCDay() + 6) % 7;And consider exposing a
weekStartsOn
ortimezone
prop if users expect non-UTC boundaries.
253-256
: Replaceid
withhs_object_id
in Meeting filters
HubSpot’s CRM v3 search endpoints expect the HubSpot record ID field namedhs_object_id
, notid
. Update the filter to:- { - propertyName: "id", - operator: "IN", - values: meetingIds, - }, + { + propertyName: "hs_object_id", + operator: "IN", + values: meetingIds, + },This aligns with HubSpot’s API behavior for meeting searches.
/approve |
This reverts commit 43c37a6.
Resolves #18199
Summary by CodeRabbit
New Features
Style
Chores