HubSpot actions
Reference for the HubSpot actions and trigger: the sign-in connection, each action id, the registered events, the fields each action reads and an example.
The HubSpot block reads and writes HubSpot CRM records and starts workflows on HubSpot events. For the plain-language guide, see HubSpot.
When to use it
Use it to read a closed deal, its quote and line items before invoicing, to look up products and owners, and to keep contacts, companies and deals in step with your ledger. Use the trigger to start a workflow when a deal, quote, company or contact changes.
Connection
- Provider id:
hubspot. Sign-in (OAuth) connection. - Pin an account with
config.connection. Without it, the step uses the company's default HubSpot connection. - Inbound events are routed to the connection whose HubSpot portal id matches the event's
portalId.
Actions
| Action id | Studio label | What it does |
|---|---|---|
hubspot.getContact | Get Contact | Read a contact. |
hubspot.createContact | Create Contact | Create a contact. |
hubspot.updateContact | Update Contact | Update a contact. |
hubspot.searchContacts | Search Contacts | Search contacts with HubSpot filter groups. |
hubspot.getCompany | Get Company | Read a company. |
hubspot.createCompany | Create Company | Create a company. |
hubspot.updateCompany | Update Company | Update a company. |
hubspot.getDeal | Get Deal | Read a deal. |
hubspot.createDeal | Create Deal | Create a deal, optionally associated with other records. |
hubspot.updateDeal | Update Deal | Update a deal. |
hubspot.searchDeals | Search Deals | Search deals with HubSpot filter groups. |
hubspot.getQuote | Get Quote | Read a quote, optionally with associations and its discounts, fees and taxes. |
hubspot.getQuoteLineItems | Get Quote Line Items | Read every line item on a quote. |
hubspot.searchQuotes | Search Quotes | |
hubspot.batchReadProducts | Batch Read Products | Read up to 100 HubSpot products by id in one request. |
hubspot.getOwner | Get Owner | Read a HubSpot owner (a record's hubspot_owner_id). |
Settings
| Field | Studio label | Type | Used by | Required for |
|---|---|---|---|---|
connection | HubSpot Account | string (connection id) | All | Optional. Without it the step uses the company default connection for this system |
contactId | Contact ID | string | getContact, updateContact | |
companyId | Company ID | string | getCompany, updateCompany | |
dealId | Deal ID | string | getDeal, updateDeal | |
quoteId | Quote ID | string | getQuote, getQuoteLineItems | |
quoteProperties | Properties (comma-separated) | string | getQuote | |
lineItemProperties | Line item properties (comma-separated; replaces the default list) | json | getQuoteLineItems | |
associations | Include Associations | string: false, true | getQuote | |
quoteAdjustments | Read quote discounts, fees and taxes | string: false, true | getQuote | |
quoteFilters | Filters (JSON) | json | searchQuotes | |
properties | Properties (JSON) | json | createContact, updateContact, createCompany, updateCompany, createDeal, updateDeal | |
productIds | Product IDs (comma-separated or JSON array, max 100) | json | batchReadProducts | batchReadProducts |
productProperties | Product properties (JSON array or comma-separated) | json | batchReadProducts | |
ownerId | Owner ID | string | getOwner | getOwner |
searchQuery | Search Query | string | searchContacts, searchDeals, searchQuotes | |
filterGroups | Filter Groups (JSON) | json | searchContacts, searchDeals, searchQuotes | |
limit | Limit | number | searchContacts, searchDeals, searchQuotes |
Fields each write action reads
The create and update executors build HubSpot properties from named fields. They do not read the Studio Properties (JSON) field (properties), so set these fields in the workflow definition:
| Action | Fields read |
|---|---|
createContact, updateContact | email, firstName, lastName, phone, company, website, jobTitle, lifecycleStage, leadStatus, address, city, state, zip, country, customProperties (object of any other HubSpot property) |
createCompany, updateCompany | name, domain, description, industry, phone, address, city, state, zip, country, website, numberOfEmployees, annualRevenue, lifecycleStage, type, customProperties |
createDeal, updateDeal | dealName, dealStage, pipeline (defaults to default on create), amount, closeDate, dealType, description, priority, customProperties; createDeal also takes associations |
updateContact, updateCompany and updateDeal also need contactId, companyId or dealId.
Search actions read filterGroups, sorts, properties (array of property names), limit (default 10) and after (paging cursor). searchQuotes also reads quoteFilters. None of them read searchQuery. getContact, getCompany and getDeal read properties as an array of property names.
Output
The step output is the HubSpot response. Records carry id and properties; searches and batchReadProducts return results. For example {{steps.get_deal.properties.amount}}.
Trigger
Trigger config type hubspot_event; the event is stored in eventKind. The handler registers these event names:
| Group | Event names |
|---|---|
| Contact | contact.creation, contact.deletion, contact.merge, contact.restore, contact.privacyDeletion, contact.propertyChange |
| Company | company.creation, company.deletion, company.merge, company.restore, company.propertyChange |
| Deal | deal.creation, deal.deletion, deal.merge, deal.restore, deal.propertyChange |
| Ticket | ticket.creation, ticket.deletion, ticket.merge, ticket.restore, ticket.propertyChange |
| Conversation | conversation.creation, conversation.deletion, conversation.newMessage, conversation.privacyDeletion, conversation.propertyChange |
| Quote | quote.creation, quote.propertyChange |
The trigger schema also accepts quote.deletion, * (any event), a <object>.* prefix, and the derived quote.published, which matches a quote.propertyChange on hs_status whose new value is APPROVED, APPROVAL_NOT_NEEDED or PUBLISHED.
Which events are delivered. HubSpot subscriptions are declared in the Loopfour HubSpot app, not registered per connection. The app subscribes to: contact creation, deletion and email changes; company creation and deletion; deal creation, deletion and changes to dealstage and install_completed; quote creation and hs_status changes; ticket creation and deletion; and contact.privacyDeletion, conversation.creation, conversation.deletion, conversation.newMessage and conversation.privacyDeletion. A trigger on any other event name is valid but does not fire.
Matching:
eventKindmust equal the event name (or match*or a prefix).- For a
.propertyChangeevent, an optionalpropertyNamemust equal the changed property. - An optional
filterapplies$eq,$ne,$inand similar operators to the event envelope, for example{"data.propertyValue": {"$eq": "closedwon"}}.
At run time the event is the run input under input.webhookEvent. Useful paths: {{input.webhookEvent.eventType}}, {{input.webhookEvent.payload.data.objectId}} (the HubSpot record id), {{input.webhookEvent.payload.data.propertyName}} and {{input.webhookEvent.payload.data.propertyValue}}.
Example
When a deal moves to closed won, read the deal and its owner.
{
"name": "Closed-won deal to billing",
"trigger": {
"type": "hubspot_event",
"eventKind": "deal.propertyChange",
"propertyName": "dealstage",
"filter": { "data.propertyValue": { "$eq": "closedwon" } }
},
"steps": [
{
"id": "get_deal",
"type": "action",
"name": "Read the deal",
"action": "hubspot.getDeal",
"config": {
"dealId": "{{input.webhookEvent.payload.data.objectId}}",
"properties": ["dealname", "amount", "closedate", "hubspot_owner_id"]
}
},
{
"id": "get_owner",
"type": "action",
"name": "Read the deal owner",
"action": "hubspot.getOwner",
"config": { "ownerId": "{{steps.get_deal.properties.hubspot_owner_id}}" }
}
]
}Live catalog
GET /api/v1/blocks/hubspotreturns the actions, fields and trigger events.GET /api/v1/blocks/hubspot/actions/<operation>/examplesreturns stored examples where they exist.
Errors and limits
- A HubSpot API error fails the step.
getQuoteLineItemsfails the step when HubSpot returns incomplete associations or pages, rather than returning a partial list.batchReadProductstakes 1 to 100 product ids after de-duplication.getOwnertakes an owner id of 1 to 20 digits.
Google Sheets actions
Reference for the Google Sheets actions: the Google connection, each action id, A1 ranges, value input options, row upserts, outputs and an example.
NetSuite actions
Reference for the NetSuite actions: the connection type, each action and what it does, its inputs and outputs, and the live catalog call.
Loopfour