Ziggy - Services and Product Help

Company name change handler

This is the Flow that actually does the work, in this case, it updates a SQL database with the changed company name.

Name change handler

Receiver

As we saw on the last page, we are adding this to a Queue. We don't have to do this but in this example, we are calling the Hubspot API. Doing so gives us rate limit protection against the Hubspot API rate limits (typically 10 calls per second).

Ziggy Queues allow you ton configure a rate limit. More about Queues.

There is also the option to add Test Data so we don't have to change Hubspot data records to test and debug the Flow.

Hubspot Read

Hubspot contains a custom property migration_uid that identifies our database company record id. We created this when we did the migration.

Another approach, which would remove the need to use this Block, would be if the database contained the Hubspot record id hs_object_id. The following Block could then match on this in the WHERE clause.

Anyway, in our case we are using the Hubspot Read Block to retrieve migration_uid.

Note that circled objectId in the Receiver Block that comes in the Webhook payload. This is used in the Hubspot Read Block as the field to lookup in Hubspot.

The last field specifies the properties we want to retrieve from Hubspot. We'll want these in the next Block. If we left this empty, then all properties would be fetched.

If we click on the edge bubble, we can see the data that is returned from Hubspot.

Hubspot data

This is passed into the SQL Block.

SQL

This contains a simple SQL update query. Note how company_name and migration_uid are parameterized.

UPDATE customers SET company_name=$name WHERE customer_id=$migration_uid

And with that, the integration is finished.

Last modified: 10 February 2025