Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[FEATURE] Hubspot - New form submission improvement #15993

Merged
merged 1 commit into from
Mar 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "hubspot-add-contact-to-list",
name: "Add Contact to List",
description: "Adds a contact to a specific static list. [See the documentation](https://legacydocs.hubspot.com/docs/methods/lists/add_contact_to_list)",
version: "0.0.14",
version: "0.0.15",
type: "action",
props: {
hubspot,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "hubspot-batch-create-or-update-contact",
name: "Batch Create or Update Contact",
description: "Create or update a batch of contacts by its ID or email. [See the documentation](https://developers.hubspot.com/docs/api/crm/contacts)",
version: "0.0.11",
version: "0.0.12",
type: "action",
props: {
hubspot,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "hubspot-create-associations",
name: "Create Associations",
description: "Create associations between objects. [See the documentation](https://developers.hubspot.com/docs/api/crm/associations#endpoint?spec=POST-/crm/v3/associations/{fromObjectType}/{toObjectType}/batch/create)",
version: "1.0.0",
version: "1.0.1",
type: "action",
props: {
hubspot,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default {
key: "hubspot-create-communication",
name: "Create Communication",
description: "Create a WhatsApp, LinkedIn, or SMS message. [See the documentation](https://developers.hubspot.com/beta-docs/reference/api/crm/engagements/communications/v3#post-%2Fcrm%2Fv3%2Fobjects%2Fcommunications)",
version: "0.0.7",
version: "0.0.8",
type: "action",
props: {
...appProp.props,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "hubspot-create-company",
name: "Create Company",
description: "Create a company in Hubspot. [See the documentation](https://developers.hubspot.com/docs/api/crm/companies#endpoint?spec=POST-/crm/v3/objects/companies)",
version: "0.0.18",
version: "0.0.19",
type: "action",
methods: {
...common.methods,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "hubspot-create-custom-object",
name: "Create Custom Object",
description: "Create a new custom object in Hubspot. [See the documentation](https://developers.hubspot.com/beta-docs/guides/api/crm/objects/custom-objects#create-a-custom-object)",
version: "1.0.0",
version: "1.0.1",
type: "action",
props: {
...appProp.props,
Expand Down
2 changes: 1 addition & 1 deletion components/hubspot/actions/create-deal/create-deal.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "hubspot-create-deal",
name: "Create Deal",
description: "Create a deal in Hubspot. [See the documentation](https://developers.hubspot.com/docs/api/crm/deals#endpoint?spec=POST-/crm/v3/objects/deals)",
version: "0.0.18",
version: "0.0.19",
type: "action",
props: {
...common.props,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default {
key: "hubspot-create-engagement",
name: "Create Engagement",
description: "Create a new engagement for a contact. [See the documentation](https://developers.hubspot.com/docs/api/crm/engagements)",
version: "0.0.17",
version: "0.0.18",
type: "action",
props: {
...common.props,
Expand Down
2 changes: 1 addition & 1 deletion components/hubspot/actions/create-lead/create-lead.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default {
key: "hubspot-create-lead",
name: "Create Lead",
description: "Create a lead in Hubspot. [See the documentation](https://developers.hubspot.com/beta-docs/guides/api/crm/objects/leads#create-leads)",
version: "0.0.6",
version: "0.0.7",
type: "action",
props: {
...appProp.props,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "hubspot-create-or-update-contact",
name: "Create or Update Contact",
description: "Create or update a contact in Hubspot. [See the documentation](https://developers.hubspot.com/docs/api/crm/contacts#endpoint?spec=POST-/crm/v3/objects/contacts)",
version: "0.0.16",
version: "0.0.17",
type: "action",
props: {
...common.props,
Expand Down
2 changes: 1 addition & 1 deletion components/hubspot/actions/create-ticket/create-ticket.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "hubspot-create-ticket",
name: "Create Ticket",
description: "Create a ticket in Hubspot. [See the documentation](https://developers.hubspot.com/docs/api/crm/tickets)",
version: "0.0.9",
version: "0.0.10",
type: "action",
props: {
...common.props,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "hubspot-enroll-contact-into-workflow",
name: "Enroll Contact Into Workflow",
description: "Add a contact to a workflow. Note: The Workflows API currently only supports contact-based workflows and is only available for Marketing Hub Enterprise accounts. [See the documentation](https://legacydocs.hubspot.com/docs/methods/workflows/add_contact)",
version: "0.0.14",
version: "0.0.15",
type: "action",
props: {
hubspot,
Expand Down
2 changes: 1 addition & 1 deletion components/hubspot/actions/get-company/get-company.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "hubspot-get-company",
name: "Get Company",
description: "Gets a company. [See the documentation](https://developers.hubspot.com/docs/api/crm/companies#endpoint?spec=GET-/crm/v3/objects/companies/{companyId})",
version: "0.0.14",
version: "0.0.15",
type: "action",
props: {
...common.props,
Expand Down
2 changes: 1 addition & 1 deletion components/hubspot/actions/get-contact/get-contact.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "hubspot-get-contact",
name: "Get Contact",
description: "Gets a contact. [See the documentation](https://developers.hubspot.com/docs/api/crm/contacts#endpoint?spec=GET-/crm/v3/objects/contacts/{contactId})",
version: "0.0.14",
version: "0.0.15",
type: "action",
props: {
...common.props,
Expand Down
2 changes: 1 addition & 1 deletion components/hubspot/actions/get-deal/get-deal.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "hubspot-get-deal",
name: "Get Deal",
description: "Gets a deal. [See the documentation](https://developers.hubspot.com/docs/api/crm/deals#endpoint?spec=GET-/crm/v3/objects/deals/{dealId})",
version: "0.0.14",
version: "0.0.15",
type: "action",
props: {
...common.props,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "hubspot-get-file-public-url",
name: "Get File Public URL",
description: "Get a publicly available URL for a file that was uploaded using a Hubspot form. [See the documentation](https://developers.hubspot.com/docs/api/files/files#endpoint?spec=GET-/files/v3/files/{fileId}/signed-url)",
version: "0.0.14",
version: "0.0.15",
type: "action",
props: {
hubspot,
Expand Down
2 changes: 1 addition & 1 deletion components/hubspot/actions/search-crm/search-crm.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default {
key: "hubspot-search-crm",
name: "Search CRM",
description: "Search companies, contacts, deals, feedback submissions, products, tickets, line-items, quotes, leads, or custom objects. [See the documentation](https://developers.hubspot.com/docs/api/crm/search)",
version: "1.0.0",
version: "1.0.1",
type: "action",
props: {
hubspot,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default {
key: "hubspot-update-company",
name: "Update Company",
description: "Update a company in Hubspot. [See the documentation](https://developers.hubspot.com/docs/api/crm/companies)",
version: "0.0.14",
version: "0.0.15",
type: "action",
methods: {
...common.methods,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default {
key: "hubspot-update-contact",
name: "Update Contact",
description: "Update a contact in Hubspot. [See the documentation](https://developers.hubspot.com/docs/api/crm/contacts#endpoint?spec=POST-/crm/v3/objects/contacts)",
version: "0.0.15",
version: "0.0.16",
type: "action",
methods: {
...common.methods,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "hubspot-update-custom-object",
name: "Update Custom Object",
description: "Update a custom object in Hubspot. [See the documentation](https://developers.hubspot.com/beta-docs/guides/api/crm/objects/custom-objects#update-existing-custom-objects)",
version: "1.0.0",
version: "1.0.1",
type: "action",
methods: {
...common.methods,
Expand Down
2 changes: 1 addition & 1 deletion components/hubspot/actions/update-deal/update-deal.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default {
key: "hubspot-update-deal",
name: "Update Deal",
description: "Update a deal in Hubspot. [See the documentation](https://developers.hubspot.com/beta-docs/guides/api/crm/objects/deals#update-deals)",
version: "0.0.5",
version: "0.0.6",
type: "action",
methods: {
...common.methods,
Expand Down
2 changes: 1 addition & 1 deletion components/hubspot/actions/update-lead/update-lead.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default {
key: "hubspot-update-lead",
name: "Update Lead",
description: "Update a lead in Hubspot. [See the documentation](https://developers.hubspot.com/beta-docs/guides/api/crm/objects/leads#update-leads)",
version: "0.0.6",
version: "0.0.7",
type: "action",
methods: {
...common.methods,
Expand Down
1 change: 1 addition & 0 deletions components/hubspot/common/constants.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const API_PATH = {
AUTOMATION: "/automation/v2",
DEAL: "/deals/v1",
BUSINESS_UNITS: "/business-units/v3",
MARKETINGV3: "/marketing/v3",
};

/** Association categories for association types, as defined by the [Hubspot API
Expand Down
9 changes: 9 additions & 0 deletions components/hubspot/hubspot.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,15 @@ export default {
...opts,
});
},
getFormDefinition({
formId, ...opts
} = {}) {
return this.makeRequest({
api: API_PATH.MARKETINGV3,
endpoint: `/forms/${formId}`,
...opts,
});
},
getForms(opts = {}) {
return this.makeRequest({
api: API_PATH.FORMS,
Expand Down
2 changes: 1 addition & 1 deletion components/hubspot/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/hubspot",
"version": "1.0.1",
"version": "1.0.2",
"description": "Pipedream Hubspot Components",
"main": "hubspot.app.mjs",
"keywords": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
export default {
...common,
key: "hubspot-delete-blog-article",
name: "Deleted Blog Posts",

Check warning on line 7 in components/hubspot/sources/delete-blog-article/delete-blog-article.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Source names should start with "New". See https://pipedream.com/docs/components/guidelines/#source-name
description: "Emit new event for each deleted blog post.",
version: "0.0.19",
version: "0.0.20",
dedupe: "unique",
type: "source",
methods: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default {
key: "hubspot-new-company-property-change",
name: "New Company Property Change",
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)",
version: "0.0.12",
version: "0.0.13",
dedupe: "unique",
type: "source",
props: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default {
key: "hubspot-new-contact-property-change",
name: "New Contact Property Change",
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)",
version: "0.0.14",
version: "0.0.15",
dedupe: "unique",
type: "source",
props: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "hubspot-new-custom-object-property-change",
name: "New Custom Object Property Change",
description: "Emit new event when a specified property is provided or updated on a custom object.",
version: "0.0.4",
version: "0.0.5",
dedupe: "unique",
type: "source",
props: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default {
key: "hubspot-new-deal-in-stage",
name: "New Deal In Stage",
description: "Emit new event for each new deal in a stage.",
version: "0.0.24",
version: "0.0.25",
dedupe: "unique",
type: "source",
props: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default {
key: "hubspot-new-deal-property-change",
name: "New Deal Property Change",
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)",
version: "0.0.13",
version: "0.0.14",
dedupe: "unique",
type: "source",
props: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default {
key: "hubspot-new-email-event",
name: "New Email Event",
description: "Emit new event for each new Hubspot email event.",
version: "0.0.22",
version: "0.0.23",
dedupe: "unique",
type: "source",
props: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "hubspot-new-email-subscriptions-timeline",
name: "New Email Subscriptions Timeline",
description: "Emit new event when a new email timeline subscription is added for the portal.",
version: "0.0.19",
version: "0.0.20",
dedupe: "unique",
type: "source",
methods: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default {
key: "hubspot-new-engagement",
name: "New Engagement",
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",
version: "0.0.24",
version: "0.0.25",
dedupe: "unique",
type: "source",
props: {
Expand Down
2 changes: 1 addition & 1 deletion components/hubspot/sources/new-event/new-event.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default {
key: "hubspot-new-event",
name: "New Events",
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",
version: "0.0.23",
version: "0.0.24",
dedupe: "unique",
type: "source",
props: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "hubspot-new-form-submission",
name: "New Form Submission",
description: "Emit new event for each new submission of a form.",
version: "0.0.24",
version: "0.0.25",
dedupe: "unique",
type: "source",
props: {
Expand All @@ -21,6 +21,40 @@ export default {
},
methods: {
...common.methods,
async paginate(params, resourceFn, resultType = null, after = null) {
let results = null;
let maxTs = after || 0;
while (!results || params.after) {
results = await resourceFn(params);
if (results.paging) {
params.after = results.paging.next.after;
} else {
delete params.after;
}
if (resultType) {
results = results[resultType];
}

for (const result of results) {
if (await this.isRelevant(result, after)) {
const form = await this.hubspot.getFormDefinition({
formId: params.formId,
});
this.emitEvent({
form,
...result,
});
const ts = this.getTs(result);
if (ts > maxTs) {
maxTs = ts;
this._setAfter(ts);
}
} else {
return;
}
}
}
},
getTs(result) {
return result.submittedAt;
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ export default {
"objectTypeId": "0-1"
}
],
"pageUrl": "https://share.hsforms.com/13MJGKokMSAmW69lIF_JiKg43od5"
"pageUrl": "https://share.hsforms.com/13MJGKokMSAmW69lIF_JiKg43od5",
"form": { "id": "4442beda-998a-4825-bba1-2eaa3c1f0038", "name": "Test form (March 20, 2025 5:24:26 PM EDT)", "createdAt": "2025-03-20T21:24:26.911Z", "updatedAt": "2025-03-20T21:28:40.822Z", "archived": false, "fieldGroups": [{ "groupType": "default_group", "richTextType": "text", "fields": [{ "objectTypeId": "0-1", "name": "firstname", "label": "First Name", "required": false, "hidden": false, "fieldType": "single_line_text" }, { "objectTypeId": "0-1", "name": "lastname", "label": "Last Name", "required": false, "hidden": false, "fieldType": "single_line_text" }, { "objectTypeId": "0-1", "name": "email", "label": "Email", "required": true, "hidden": false, "validation": { "blockedEmailDomains": [], "useDefaultBlockList": false }, "fieldType": "email" }] }], "configuration": { "language": "en", "cloneable": true, "postSubmitAction": { "type": "thank_you", "value": "" }, "editable": true, "archivable": true, "recaptchaEnabled": false, "notifyContactOwner": false, "notifyRecipients": ["78708658"], "createNewContactForNewEmail": false, "prePopulateKnownValues": true, "allowLinkToResetKnownValues": false, "lifecycleStages": [] }, "displayOptions": { "renderRawHtml": false, "theme": "default_style", "submitButtonText": "", "style": { "fontFamily": "arial, helvetica, sans-serif", "backgroundWidth": "100%", "labelTextColor": "#33475b", "labelTextSize": "11px", "helpTextColor": "#7C98B6", "helpTextSize": "11px", "legalConsentTextColor": "#33475b", "legalConsentTextSize": "14px", "submitColor": "#ff7a59", "submitAlignment": "left", "submitFontColor": "#ffffff", "submitSize": "12px" }, "cssClass": null }, "legalConsentOptions": { "type": "none" }, "formType": "hubspot" }
}
2 changes: 1 addition & 1 deletion components/hubspot/sources/new-note/new-note.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default {
key: "hubspot-new-note",
name: "New Note Created",
description: "Emit new event for each new note created. [See the documentation](https://developers.hubspot.com/docs/reference/api/crm/engagements/notes#get-%2Fcrm%2Fv3%2Fobjects%2Fnotes)",
version: "1.0.0",
version: "1.0.1",
type: "source",
dedupe: "unique",
methods: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default {
key: "hubspot-new-or-updated-blog-article",
name: "New or Updated Blog Post",
description: "Emit new event for each new or updated blog post in Hubspot.",
version: "0.0.6",
version: "0.0.7",
dedupe: "unique",
type: "source",
props: {
Expand Down
Loading
Loading