Building pipelines with HubSpot Writer
You can write to HubSpot using the HubSpot Writer as a target in your Striim pipelines. The HubSpot Writer receives data from any Striim source and writes it to HubSpot CRM objects.
The HubSpot Writer supports the following write operations:
INSERT: Create new records in HubSpot.
UPDATE (in Merge mode): Modify existing records in HubSpot.
DELETE: Remove records from HubSpot.
You can create applications using Flow Designer, TQL, or Striim's REST API.
Create a HubSpot Writer application using the Flow Designer
This procedure outlines how to use Striim's Flow Designer to build and configure data pipelines with HubSpot Writer as the target.
Go to the Apps page in the Striim UI and click Start from scratch.
Provide the Name and Namespace for your app. The namespace helps organize related apps.
Add a source component to read data from your desired data source.
In the component section, expand Targets, and enter a keyword such as HubSpot Writer in the search field to filter available targets.
Select the desired target (HubSpot Writer).
In the properties panel, provide the properties for the writer including authentication mode, credentials, target objects, key columns, and column mappings.
Click Save to complete the properties configuration.
You can drag and drop processors or enrichers between the source and target to transform data as needed.
Once done, deploy and start the application to begin data flow.
Create a HubSpot Writer application using TQL
The following sample TQL demonstrates how to write data from a SQL Server source to HubSpot contacts using Private App Token authentication.
CREATE OR REPLACE APPLICATION HubSpot; CREATE OR REPLACE STREAM HStream OF Global.WAEvent; CREATE OR REPLACE SOURCE SQLReader USING Global.DatabaseReader ( QuiesceOnILCompletion: true, ConnectionURL: 'jdbc:sqlserver://;serverName=localhost;databaseName=testdb', Tables: 'hubspot.contact', FetchSize: 100, Username: '<username>', Password: '<password>', DatabaseProviderType: 'SQLServer' ) OUTPUT TO HStream; CREATE OR REPLACE TARGET HubSpotWriter USING Global.HubSpotWriter ( privateAppToken: '<your-private-app-token>', authMode: 'PrivateAppToken', Tables: 'testdb.hubspot.contact,contacts keycolumns(EMAIL) columnmap(FIRSTNAME=firstname,EMAIL=email)', Mode: 'MERGE', BatchPolicy: 'eventCount:100, Interval:60' ) INPUT FROM HStream; END APPLICATION HubSpot;
For OAuth 2.0 authentication, replace the authentication properties with OAuth credentials:
CREATE OR REPLACE TARGET HubSpotWriter USING Global.HubSpotWriter ( authMode: 'OAuth', clientId: '<your-client-id>', clientSecret: '<your-client-secret>', refreshToken: '<your-refresh-token>', Tables: 'schema.table,hubspot_object keycolumns(KEY_COL) columnmap(SRC_COL=tgt_col)', Mode: 'MERGE', BatchPolicy: 'eventCount:100, Interval:60' ) INPUT FROM HStream;