Skip to content

Conversation

luancazarine
Copy link
Collaborator

@luancazarine luancazarine commented Sep 11, 2025

Resolves #18199

Summary by CodeRabbit

  • Chores
    • Bumped HubSpot integration package version to 1.7.3.
    • Updated Batch Upsert Companies action metadata version to 0.0.7.
    • No changes to functionality, inputs, endpoints, or behavior.
    • Users should expect the same experience; this is a maintenance release for version alignment and housekeeping.

- 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.
- 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.
- 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.
…maintain compatibility with the latest API changes.
Copy link

vercel bot commented Sep 11, 2025

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

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
pipedream-docs Ignored Ignored Sep 11, 2025 7:22pm
pipedream-docs-redirect-do-not-edit Ignored Ignored Sep 11, 2025 7:22pm

Copy link
Contributor

coderabbitai bot commented Sep 11, 2025

Walkthrough

Bumped version fields: the HubSpot batch-upsert-companies action from 0.0.6 to 0.0.7 and the HubSpot package from 1.7.2 to 1.7.3. No code, logic, inputs, or control flow changes.

Changes

Cohort / File(s) Summary
HubSpot Action Version Bump
components/hubspot/actions/batch-upsert-companies/batch-upsert-companies.mjs
Updated exported action metadata version from "0.0.6" to "0.0.7". No functional changes.
Package Version Bump
components/hubspot/package.json
Incremented package version from "1.7.2" to "1.7.3". No other fields modified.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Pre-merge checks (1 passed, 4 warnings)

❌ Failed checks (4 warnings)
Check name Status Explanation Resolution
Title Check ⚠️ Warning The title "18199 action hubspot workflow api" implies the PR implements HubSpot Workflow API actions, but the changeset in the provided summary only updates version fields: the action version in components/hubspot/actions/batch-upsert-companies/batch-upsert-companies.mjs (0.0.6 → 0.0.7) and components/hubspot/package.json (1.7.2 → 1.7.3). No workflow endpoints, new action files, or functional changes matching the title are present, so the title is misleading for reviewers. Update the title to reflect the actual change or add the missing workflow API implementations so the title is accurate. Either retitle the PR to accurately describe the contents (for example "chore(hubspot): bump component to 1.7.3 and action to 0.0.7") or add the intended HubSpot Workflow API action implementations, tests, and documentation so the title correctly reflects the changes; if both sets of changes are intended, split them into separate PRs and link them.
Linked Issues Check ⚠️ Warning Issue #18199 requests multiple HubSpot Workflow API actions—grouped as retrieval endpoints (emails, workflows, flow details), mutation endpoints (create, update, delete), and batch/mapping operations (batch read workflows, workflow-id-mappings)—but the provided changeset contains only version number updates and no implementations for any of the requested endpoints. Therefore the PR does not satisfy the coding objectives in [#18199]. To meet the linked-issue requirements, the PR must include the action implementations, request/response handling, tests, and documentation for the listed endpoints. Add the implementations for the grouped endpoints (retrieval, mutation, and batch/mapping), include unit or integration tests and documentation, and then update the PR description and title to reflect the completed work; if the PR scope was different, remove or correct the issue linkage.
Out of Scope Changes Check ⚠️ Warning The PR's edits are limited to version bumps in components/hubspot/package.json and an action's exported version, which are unrelated to the workflow API feature requested in issue #18199; because they do not implement the requested endpoints, these changes are out-of-scope relative to the linked issue and may confuse reviewers. Such maintenance changes should be separated from feature work or clearly justified in the PR description. Aligning scope will make review and release tracking clearer. Move unrelated version-bump commits to a separate "chore: bump hubspot versions" PR and limit this PR to the functional HubSpot Workflow API changes with tests and docs, or explicitly document why the version bumps are required here and add the missing feature code in the same PR.
Description Check ⚠️ Warning The repository's required PR template requires a "## WHY" section that explains the motivation and scope, but the current description only contains "Resolves #18199" and does not follow the template or explain what was changed, why, or how to validate the work. This omission leaves reviewers without context for the change and whether it implements the linked issue. The description must be expanded to enable proper review. Populate the "## WHY" section with a concise summary of the PR goals, a list of implemented endpoints or files changed, testing/validation steps, and links to issue #18199; if the PR only performs a version bump, state that explicitly and explain the rationale.
✅ Passed checks (1 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

Poem

I twitch my whiskers—versions hopped,
From six to seven, locks now topped.
The package, too, a gentle nudge,
No code disturbed, no flows to fudge.
I thump: “Release!” then nibble greens—
A tidy trail in version scenes. 🐇✨

✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 18199-action-hubspot-workflow-api

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 (1)
components/hubspot/actions/batch-upsert-companies/batch-upsert-companies.mjs (1)

48-52: Brittle error parsing can throw in the catch block. Replace with resilient extraction.

Nested JSON.parse + regex splits assume a very specific error shape and will themselves throw, masking the original error. Prefer checking error.response?.data (Axios), HubSpot error arrays, and falling back to error.message.

Apply:

-    } catch (error) {
-      const message = JSON.parse(
-        JSON.parse(error.message).message.split(/:(.+)/)[1],
-      )[0].message;
-      throw new ConfigurationError(message.split(/:(.+)/)[0]);
-    }
+    } catch (error) {
+      // Prefer Axios / HubSpot error structures, with safe fallbacks
+      const data = error?.response?.data;
+      const message =
+        data?.message
+        ?? data?.errors?.[0]?.message
+        ?? data?.status
+        ?? error?.message
+        ?? "Unknown error";
+      throw new ConfigurationError(String(message));
+    }
🧹 Nitpick comments (4)
components/hubspot/package.json (1)

3-3: Patch bump looks fine, but PR scope doesn’t match the objective.

This PR only bumps the HubSpot package version to 1.7.3. The PR title/issue #18199 requests new HubSpot Workflow API actions (flows CRUD, batch read, mappings, emails). None of those files are included here. Please confirm whether:

  • This PR is intentionally scoped to a republish/version bump, or
  • The Workflow actions are missing and should be added to this PR (or a separate PR), and the title/description updated accordingly.

If you want, I can scaffold action files for the Workflow endpoints listed in the issue.

components/hubspot/actions/batch-upsert-companies/batch-upsert-companies.mjs (3)

21-25: Validate and normalize inputs before sending.

inputs is declared as a string[], then passed through parseObject. Depending on UI serialization, this can be an array already or a JSON string; if parsing fails or returns a non-array, the request will 400. Add normalization + schema validation and fail fast with a clear message.

Proposed change:

   inputs: {
     type: "string[]",
     label: "Inputs (Companies)",
     description:
       "Provide a **list of companies** to be upserted. [See the documentation](https://developers.hubspot.com/docs/reference/api/crm/objects/companies#post-%2Fcrm%2Fv3%2Fobjects%2Fcompanies%2Fbatch%2Fupsert) for more information. Example: `[ { \"idProperty\": \"unique_property\", \"id\": \"123\", \"properties\": { \"name\": \"CompanyName\" } } ]`",
   },
-          inputs: parseObject(this.inputs),
+          inputs: Array.isArray(this.inputs)
+            ? this.inputs
+            : parseObject(this.inputs),

Optionally, guard against bad shapes:

+      if (!Array.isArray(inputs) || inputs.some((i) => typeof i !== "object")) {
+        throw new ConfigurationError("`inputs` must be an array of objects");
+      }

45-46: Defensive summary to avoid crashes when results is absent.

Some HubSpot errors still return 200 with partials, or network retries might return undefined. Guard results to avoid a TypeError.

-      $.export("$summary", `Upserted ${response.results.length} companies`);
+      $.export("$summary", `Upserted ${response?.results?.length ?? 0} companies`);

1-55: Scope gap: Workflow API actions are missing from this PR.

Per issue #18199, we need actions for:

  • GET /automation/v4/flows/email-campaigns
  • GET /automation/v4/flows/{flowId}
  • GET /automation/v4/flows
  • POST /automation/v4/flows
  • POST /automation/v4/flows/batch/read
  • PUT /automation/v4/flows/{flowId}
  • DELETE /automation/v4/flows/{flowId}
  • POST /automation/v4/workflow-id-mappings/batch/read

Please add these actions (or open a separate PR) and wire them to hubspot.makeRequest under an automation/v4 API path constant. I can provide scaffolds matching the existing action patterns.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 944bcf0 and 49207c9.

📒 Files selected for processing (2)
  • components/hubspot/actions/batch-upsert-companies/batch-upsert-companies.mjs (1 hunks)
  • components/hubspot/package.json (1 hunks)
⏰ 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: Lint Code Base
  • GitHub Check: Verify TypeScript components
🔇 Additional comments (1)
components/hubspot/actions/batch-upsert-companies/batch-upsert-companies.mjs (1)

10-10: Version bump only — no functional change.

Safe to publish as a patch to re-release metadata or docs updates.

@luancazarine luancazarine merged commit c7f60dc into master Sep 11, 2025
10 checks passed
@luancazarine luancazarine deleted the 18199-action-hubspot-workflow-api branch September 11, 2025 19:50
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.

[ACTION] Hubspot Workflow API
2 participants