Hubspot
The Hubspot Block is a good example of a Custom Block. While you could use Javascript, it makes for a quicker and friendlier experience if you use the Hubspot API frequently.
It does not encapsulate every Hubspot method but the most commonly used methods are there. And you can, of course, always extend its capabilities or create additional Blocks.
Connection
A Connection needs to be specified. This contains that configuration details, such as the API key. It also allows the appropriate Development and Production configuration to be automatically selected.
Creating or upserting records in Hubspot Objects
Below is an example of Company record creation.

A SQL database table provides the source data (but it can, of course, come from any data source).
The data is mapped from the database field structure to a Hubspot compatible structure. This mapping configured on the edge rather than in a Block.
Hubspot companies are then created. You just specify the Object name in the Block.
We also specify the Unique id property name as we are upserting. Upsert and Update operations require a unique id field that exists in both the edge data and the Hubspot record.
This whole process uses Batching so as not to overload the system or the Hubspot API. You can see that we have batches of 20 records configured in the SQL Block.
Reading from Hubspot
The principle is very similar. You select Batch read or Single read and specify the Hubspot object type.
If you select Batch read then batching is automatically enabled and set to a batch size of 100 records. You should be sure to use a Batch End in your Flow.
