Skip to main content
A HubSpot workflow webhook sends data from HubSpot to Cometly each time a contact enters a workflow you choose. Cometly receives it as a server event: an event (a conversion such as a lead, a booked meeting or a closed deal) that arrives from a server instead of from your website. This matters because much of what happens to a lead happens in HubSpot, after the form fill. Once those moments reach Cometly, you can see which ad or channel produced each one, and you decide in the workflow exactly which events are sent and when. Webhooks in HubSpot workflows are an alternative to Cometly’s direct HubSpot integration. To use the direct integration instead, see HubSpot.
Workflows must be included in your HubSpot plan to send server events directly from HubSpot. If your plan does not include Workflows, you can use Zapier to send events.
If you use HubSpot marketing forms on your website, make sure your forms are tracked properly before you send events. See HubSpot legacy forms or HubSpot forms (new forms).

Before you start

You need a Cometly API token. In Cometly, go to Integrations > Cometly API, click Activate Cometly API if it is not active yet, then create a token under API Tokens with Create Token. See Cometly API.
Step 2 Manage API tokens on the Cometly API page, showing the Token Name field and the Your Tokens list, with a box around the Create Token button.

Send an event from a HubSpot workflow

1

Configure your HubSpot workflow trigger

Create a new HubSpot workflow and configure the trigger based on the event you want to send to Cometly.
2

Add the Send a webhook action

Create an action and choose Send a webhook.
3

Configure the webhook

  1. For Method, select POST.
    HubSpot Send a webhook panel with POST highlighted in the Method list
  2. For Webhook URL, enter:
    HubSpot webhook action with Method POST and the Cometly API URL in Webhook URL
  3. For Authentication type, select API Key.
    HubSpot Authentication type list with API Key selected
  4. For API key, click Add secret.
    HubSpot API key secret list with the Add secret link highlighted
  5. For Secret name, enter cometly or any other name that identifies the Cometly key. For Secret value, enter Bearer XXXXXXXXXXXXXXXX, with your Cometly API token in place of XXXXXXXXXXXXXXXX.
    HubSpot Add secret dialog with the name cometly and a Bearer placeholder value
    Example secret value:
  6. Make sure API key name is Authorization and API key location is Request header.
    HubSpot API key name set to Authorization and API key location set to Request header
4

Build the request body

The request body has property values and static values. A property value is filled in from a HubSpot property, so it changes with each contact. A static value is fixed.Static valueThe only static value should be the key event_name, with the name of the event as its value. You can find the event names (standard events and custom_event_1 to custom_event_50) in the Create Event reference.
HubSpot request body with a static value event_name set to custom_event_1
Property valuesThe property keys must match the field names in the Create Event reference. For each key, choose the HubSpot property to send where it says Select a property.
An event_name and an email are required in the payload. You can add any other field available in the Cometly developer documentation.
HubSpot request body mapping email, first_name, last_name, phone and amount to HubSpot properties
5

Save and test

  1. Save the webhook configuration.
  2. Enroll a contact to test the workflow.
  3. In Cometly, go to Events Manager and open the Events Log tab to check that the server event was received.

Configure a HubSpot trigger for a booked meeting

This section shows you how to set up a HubSpot workflow trigger that fires when a new meeting is booked.

Open the workflow builder

  1. Log in to your HubSpot account.
  2. Go to Automation > Workflows in the main menu.
  3. Open the workflow where you want to set up the trigger.

Configure the enrollment trigger

  1. In the workflow editor, click Enrollment Triggers in the left-hand panel.
  2. Under “Automatically trigger enrollment”, select When an event occurs.
    HubSpot Enrollment triggers panel with When an event occurs highlighted
  3. Choose the event type Meeting booked. It shows as Has completed: Meeting booked.
    HubSpot enrollment trigger showing Has completed: Meeting booked
  4. Add criteria to filter the meeting type, for example meeting type equals Product Demo. You can use any criteria, so that the workflow only triggers when that specific meeting is booked.
    HubSpot Add criteria list for Meeting booked, including Call and meeting type
  5. Click Done to confirm the setup.

Re-enrollment settings

Leave re-enrollment OFF to prevent duplicate enrollments, so Cometly tracks the first time a new meeting is booked. If you want to track every meeting, you can turn re-enrollment on, but we recommend keeping it off for better data.
HubSpot Re-enrollment tab with the re-enroll toggle set to OFF

Add the action that sends the webhook to Cometly

  1. Add the action that runs when the trigger fires: select Send a webhook under Data ops.
  2. Configure the webhook settings (URL, authentication and payload) in one of two ways:
    • As described in Send an event from a HubSpot workflow above.
    • With a Cometly webhook URL. Add the URL to the action, and HubSpot sends the data to Cometly. The Cometly webhooks guide explains how to create the webhook in Cometly, select or create its event, map the webhook data to the Cometly fields, and set up filters so only the data you want is tracked.

Review and publish the workflow in HubSpot

  1. Review your workflow to make sure all conditions and actions are configured correctly.
  2. Click Save to finalize the trigger and Publish to activate the workflow.

Send Deal Won to Cometly with Zapier

You can also send HubSpot deal events with Zapier. The video below shows how to send a closed won deal to Cometly.

Check it worked

Enroll a test contact in the workflow, then open Events Manager in Cometly and click the Events Log tab. With Source set to Server, the event you sent is listed, and its Details column shows SUCCESS.

Frequently asked questions

Should I use HubSpot workflow webhooks or the Cometly HubSpot integration?

Use the direct HubSpot integration if its triggers cover what you need: a contact created, a contact or deal property change, or a deal created, moved or won. Use workflow webhooks when you want full control over which events are sent and when, such as a booked meeting of one specific type.

Why is my HubSpot webhook event not showing up in Cometly?

Check the request first. Cometly rejects it when the API token is missing or invalid, or when the body has no event_name or no email, so confirm the secret value starts with Bearer followed by your token and that both keys are in the request body. Then open the Events Log: an event with a problem has a red badge, and its Details column shows the error message.

Can I send the deal or sale amount from HubSpot to Cometly?

Yes. Add the key amount to the request body and choose the HubSpot property that holds the value. The value must be a number.

Next steps

Still have questions or need a hand? We’re happy to help. Reach our team at support@cometly.com.