--- title: "Create a HubSpot Workflow for Recipient Based Targeting" slug: "create-a-hubspot-workflow" updated: 2026-09-21T17:04:06Z published: 2026-09-21T17:04:06Z canonical: "help.opensense.com/create-a-hubspot-workflow" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.opensense.com/llms.txt > Use this file to discover all available pages before exploring further. # Create a HubSpot Workflow for Recipient Based Targeting ## Overview Learn how to build a HubSpot workflow that writes an Opensense tag to a contact record, so the right banner shows in that contact's emails. This guide covers HubSpot's current workflow builder, including how to target contacts using properties on the contact record, on associated records such as Company, and on custom objects. > [!NOTE] > Before you start > > You'll need: > > - The Opensense HubSpot integration connected, with the **sgentags** contact property created during setup > - HubSpot permissions to create and publish workflows > - A banner campaign in the Opensense portal, or a plan for the tag value you'll assign — see [configuring campaigns](https://help.opensense.com/v1/docs/creating-banner-campaign) and [tags](https://help.opensense.com/v1/docs/creating-banner-campaign#3-select-tags) > - A test contact record you can send to and check against This article uses one worked example throughout: showing an accounting-industry webinar banner to every contact who works at a company in the Accounting industry. The tag value is **accounting_industry**. ## Part 1: Build the HubSpot workflow ### Step 1: Start a new workflow In HubSpot, go to **Automations** > **Workflows**, then click **Create workflow**. ![HubSpot Automation page on the Workflows tab with the Create workflow button in the top right](https://cdn.document360.io/05b0e12d-96a6-4b75-a423-672ab2be88d7/Images/Documentation/image-1789686633040.png) ### Step 2: Choose From scratch In the **Create workflow** dropdown, click **From scratch**. ![Create workflow dropdown open showing From scratch, From template, With AI, and With new builder options](https://cdn.document360.io/05b0e12d-96a6-4b75-a423-672ab2be88d7/Images/Documentation/image-1789686612491.png) ### Step 3: Choose a trigger type On the **Triggers** panel, click **Met filter criteria**. This enrolls records whenever they match the conditions you set in the next steps. ![Triggers panel with Trigger manually, Met filter criteria, and On a schedule options, Met filter criteria selected](https://cdn.document360.io/05b0e12d-96a6-4b75-a423-672ab2be88d7/Images/Documentation/How%20to%20Create%20a%20Workflow%20Based%20on%20Contact%20Properties%20-%20Step%202.jpeg) ### Step 4: Choose the record type that can enroll Select **Contact**. Opensense tags are written to contact records, so contacts must be the enrolling record type even when your targeting criteria live on another object. ![Choose a type of record that can enroll list showing Contact, Company, Deal, Ticket and other record types](https://cdn.document360.io/05b0e12d-96a6-4b75-a423-672ab2be88d7/Images/Documentation/How%20to%20Create%20a%20Workflow%20Based%20on%20Contact%20Properties%20-%20Step%203.jpeg) ### Step 5: Set your enrollment criteria Click **Add criteria**. The criteria panel opens with a **Viewing** dropdown at the top, set to **Contacts (primary)** by default. This dropdown is what lets you target on records other than the contact. Use the **Viewing** dropdown to choose where your criteria come from: - **Contacts (primary)** — properties on the enrolled contact record itself, such as Job Title or Lifecycle Stage - **An associated object** — properties on a record the contact is associated with, such as Company or Deal - **A custom object** — any custom object in your portal, listed under **Custom Objects** at the bottom of the dropdown ![Viewing dropdown open on the criteria panel showing standard objects and a Custom Objects section](https://cdn.document360.io/05b0e12d-96a6-4b75-a423-672ab2be88d7/Images/Documentation/How%20to%20Create%20a%20Workflow%20Based%20on%20Contact%20Properties%20-%20Step%205.jpeg) Once you've chosen an object, pick a filter type using the tabs below the dropdown: - **Properties** — filter on a property value, such as Industry or Country - **Events** — filter on an activity or event - **Memberships** — filter on list, workflow, or import membership ![Criteria panel on the Properties tab with a search field for Contact properties and grouped property list](https://cdn.document360.io/05b0e12d-96a6-4b75-a423-672ab2be88d7/Images/Documentation/How%20to%20Create%20a%20Workflow%20Based%20on%20Contact%20Properties%20-%20Step%206.jpeg) To target a list instead of a property, open the **Memberships** tab and choose **Segment (List) membership**, then select your list. ![Criteria panel on the Memberships tab showing Segment (List) membership, Workflow enrollment, and Import membership](https://cdn.document360.io/05b0e12d-96a6-4b75-a423-672ab2be88d7/Images/Documentation/How%20to%20Create%20a%20Workflow%20Based%20on%20Contact%20Properties%20-%20Step%207.jpeg) ### Step 6: Review the criteria group and continue Your finished criteria appear as a group on the right. In this example, the group reads: **Contact is associated to Any Company where any of the associated companies match: Industry is any of Accounting**. Click **Next**. ![Enrollment criteria showing Contact associated to Any Company where Industry is any of Accounting, with Next button](https://cdn.document360.io/05b0e12d-96a6-4b75-a423-672ab2be88d7/Images/Documentation/How%20to%20Create%20a%20Workflow%20Based%20on%20Contact%20Properties%20-%20Step%208.jpeg) > [!WARNING] > **Expected result** > > The trigger card at the top of the canvas summarizes your conditions instead of showing "No enrollment conditions". ### Step 7: Set re-enrollment, then save On the **Settings** step, decide whether contacts can re-enroll after completing the workflow, then click **Save and continue**. ![Triggers Settings step showing the Re-enroll toggle and the Save and continue button](https://cdn.document360.io/05b0e12d-96a6-4b75-a423-672ab2be88d7/Images/Documentation/How%20to%20Create%20a%20Workflow%20Based%20on%20Contact%20Properties%20-%20Step%209.jpeg) Leave re-enrollment off if a contact should be tagged once. Turn it on if contacts may qualify again later — for example, if they move to a company in a different industry and should pick up a different banner. ### Step 8: Add the Edit record action Click the **+** below the trigger card to add an action. In the **Choose an action** panel, search for **edit record**, then select **Edit record** under **CRM**. ![Choose an action panel with edit record searched and the CRM Edit record action highlighted](https://cdn.document360.io/05b0e12d-96a6-4b75-a423-672ab2be88d7/Images/Documentation/How%20to%20Create%20a%20Workflow%20Based%20on%20Contact%20Properties%20-%20Step%2010.jpeg) ### Step 9: Choose the sgentags property Leave **Record type** set to **Contact (Current object)**. Open the **Property to edit** dropdown, search for **sgentags**, and select it. The property is labeled **Opensense Ads (Campaign Tag)**. ![Edit record panel with Record type set to Contact Current object and the Property to edit dropdown](https://cdn.document360.io/05b0e12d-96a6-4b75-a423-672ab2be88d7/Images/Documentation/How%20to%20Create%20a%20Workflow%20Based%20on%20Contact%20Properties%20-%20Step%2011.jpeg) ![Property dropdown with sgentags searched, showing the sgentags Opensense Ads Campaign Tag result](https://cdn.document360.io/05b0e12d-96a6-4b75-a423-672ab2be88d7/Images/Documentation/How%20to%20Create%20a%20Workflow%20Based%20on%20Contact%20Properties%20-%20Step%2013.jpeg) > [!NOTE] > Tip > > Use **sgenads** instead of **sgentags** to set a static banner rather than a tag-matched campaign. ### Step 10: Set the tag value Set **Change type** to **Replace**, then enter your tag in the **Choose a value** field. In this example the value is **accounting_industry**. Click **Save**. ![Edit record panel with sgentags selected, Change type Replace, and accounting_industry entered as the value](https://cdn.document360.io/05b0e12d-96a6-4b75-a423-672ab2be88d7/Images/Documentation/How%20to%20Create%20a%20Workflow%20Based%20on%20Contact%20Properties%20-%20Step%2016.jpeg) **Change type replaces the old checkbox.** Earlier versions of the workflow builder used a **Clear existing property value** checkbox. The current builder uses the **Change type** dropdown instead. **Replace** overwrites whatever tag the contact already has. #### Tag value formats You can assign more than one tag by separating values with commas. The number of times a tag appears controls how often that banner displays relative to the others. - **sales** — a single tag - **sales, marketing, sales** — controls display frequency - **sales, marketing, sales, inbound24** — rotates banners ### Step 11: Review the workflow and turn it on The canvas now shows your trigger and a single action reading **Set sgentags to accounting_industry**. Name the workflow, then click **Review and turn on**. ![Completed workflow canvas showing the enrollment trigger and an Edit record action setting sgentags](https://cdn.document360.io/05b0e12d-96a6-4b75-a423-672ab2be88d7/Images/Documentation/How%20to%20Create%20a%20Workflow%20Based%20on%20Contact%20Properties%20-%20Step%2017.png) **Expected result:** Matching contacts enroll and their **sgentags** property is populated with your tag value. ## Part 2: Match the tag to your Opensense campaign The workflow writes a value to HubSpot, but nothing displays until a campaign in the Opensense portal carries a tag that matches that value. In the Opensense portal, go to **Marketing** > **Campaigns**, find your campaign, and confirm its tag matches the **sgentags** value exactly. In this example, the campaign **accounting_vertical_webinar_2026** carries the tag **accounting_industry**, matching the value the workflow writes. ![Opensense Campaigns page with a campaign showing the tag accounting_industry below the campaign name](https://cdn.document360.io/05b0e12d-96a6-4b75-a423-672ab2be88d7/Images/Documentation/Campaign%20with%20segment%20tag.png) **Tags must match exactly.** Use lowercase letters, numbers, and underscores only. Tags are case-sensitive, and spaces, hyphens, and other characters will not match. **accounting_industry** and **Accounting Industry** are two different tags, and the second one will never resolve to a banner. ## Part 3: Verify the banner resolves for a recipient Once the workflow has run and the campaign is set up, confirm the correct banner is selected for a specific contact before you roll the workflow out more widely. 1. In the Opensense portal, go to **Manage** > **Integrations** 2. Click your HubSpot integration 3. Open the **Diagnostics** tab 4. In the **Diagnostics** field, enter the email address of the contact record you're testing with 5. Click **Refresh** ![HubSpot integration Diagnostics tab with an email address entered and the Refresh button](https://cdn.document360.io/05b0e12d-96a6-4b75-a423-672ab2be88d7/Images/Documentation/abm%20testing%20-%20hubspot%20integration%20diagnostics.png) Check the **Rendered HTML** section. It shows the ad token selected for that recipient — in this example, **[[ad:accounting_vertical_webinar_2026]]**, the campaign matched by the **accounting_industry** tag. ![Diagnostics tab with the Rendered HTML section showing the resolved ad token for the tested recipient](https://cdn.document360.io/05b0e12d-96a6-4b75-a423-672ab2be88d7/Images/Documentation/abm%20testing%20-%20hubspot%20integration%20diagnostics%20result.png) **How to verify it worked:** **Rendered HTML** shows the campaign name you expected for that recipient. If it shows a different campaign, or no ad token, work through the troubleshooting steps below. --- ### Troubleshooting #### Rendered HTML shows no ad token for the test recipient. Check that the contact actually enrolled in the workflow and that **sgentags** is populated on their contact record in HubSpot. If the property is empty, the contact didn't meet your enrollment criteria — revisit Step 5, particularly the **Viewing** dropdown, and confirm you filtered on the object you intended. #### sgentags is populated, but no banner resolves. Compare the tag on the campaign with the value in **sgentags** character by character. Capital letters, spaces, and hyphens are the most common causes. Confirm the campaign status is **Active**. #### The wrong banner shows for a contact. A contact may carry tags from more than one workflow. Check the full value of **sgentags** on the contact record — if it holds several comma-separated tags, banners rotate among the matching campaigns. Set **Change type** to **Replace** rather than **Add to current value** if a workflow should overwrite previous tags. For more help, contact [help@opensense.com](mailto:help@opensense.com). ## What's next - [Creating a banner campaign](https://help.opensense.com/v1/docs/creating-banner-campaign) - [Selecting tags for a campaign](https://help.opensense.com/v1/docs/creating-banner-campaign#3-select-tags)