Logo
Home
Resources

Product

Custom Workflow

Resources

Blog
Youtube
Template
Home
>
Product
>
Template Top
>
detail

HubSpot Custom Workflow Guide: How to Automatically "Search" for and "Associate" Contacts

As you build more advanced HubSpot workflows, you'll often encounter the need to connect contacts, such as automatically associating a new contact (Contact A) with an existing contact (Contact B) who shares the same company name.

Standard workflow functions can make this "dynamic search and associate" process difficult. This is where 3rd-party custom workflow actions become essential.

This article explains the purpose, common use cases, and setup steps for the "Contact Search Action" shown in your video, with the ultimate goal of automatic association.

‍

Demo Video

Over view
Code

Detail

Purpose of the Action

The primary purpose of this action is to search your HubSpot database for a different contact (Contact B) based on information from the contact currently enrolled in the workflow (Contact A).

The action's only output is the Record ID (Contact ID) of the contact it finds. The ultimate goal is to use this ID in a subsequent step to automatically associate Contact A and Contact B.

Common Use Cases

This action is extremely powerful for automatically building relationships between your contacts.

  • Referral ProgramsWhen a new contact (A) signs up with a "Referrer Code," this action can search for the existing contact (B) who owns that code. If found, it can then associate A and B.
  • Family or Household LinkingWhen a new event attendee (A) registers, this action can search for another contact (B) with the same "Last Name" AND "Postal Code" and then automatically associate them.
  • B2B Contact-to-Account LinkingWhen a new contact (A) is created, this action can search for an existing contact (B) with the same "Company Domain" and associate them.

Step-by-Step Guide from the Video Demo

The video demonstrates the setup and execution of the search action itself.

Step 1: Add the Action (0:04 - 0:09)In the workflow editor, click the "+" icon to add an action. The left sidebar opens, showing available actions. The video selects the app "Custom Workflow Business V2."

Step 2: Select the "Contact Search Action" (0:10 - 0:12)From the app's list of available actions, click on "Contact Search Action" to add it to the workflow.

Step 3: Configure Search Criteria (0:13 - 0:43)In the action's setup panel on the left, you define who you are looking for.

  • First Condition:Set the Condition - Property Name (e.g., First Name), the Condition - Search Operator (e.g., Equal to), and the Condition - Value (e.g., "Brian"). This value can be a static value, as shown, or a personalization token from the enrolled contact.
  • Second Condition (Optional):This action allows for a second, combined search condition (the video shows Domain as an option).
  • Condition Logic:You can use the Operator between Conditions to set the logic to "AND (both must be true)" or "OR (either can be true)."
  • Exclusion:The Contact ID field can be used to exclude a specific contact from the search results (for example, using the enrolled contact's own ID token to avoid finding itself).

Step 4: Save Configuration (0:44 - 0:46)Click the "Save" button. The workflow card updates to show a summary of your criteria (e.g., Search contacts where First Name Equal to Brian).

Step 5: Run Workflow & Check History (0:47 - 0:56)The workflow is turned on and run (using a manual trigger in the demo).After it runs, check the "History" tab. You can see the "Contact Search Action" has "Action succeeded."By clicking to see the log details (right panel), you can inspect the "OUTPUTS" section. It clearly shows the search_results with the Record ID it found (in the video, "501").

Step 6: Verify the Result (0:57 - 1:00)(As a supplement to the demo) You can then go to your HubSpot contact list and confirm that the contact with Record ID "501" is, in fact, "Brian Halligan," confirming the search was successful.

[IMPORTANT] How to Use the Record ID for Association

This action only finds the Record ID. To achieve your goal of associating the contacts, you must add these follow-up steps.

  1. Add an If/then BranchImmediately after the "Contact Search Action," add a standard HubSpot "If/then branch" action.
  2. Set Branch CriteriaSet the branch condition to check if the output from the "Contact Search Action" (search_results) "is known". This creates a "Yes" path (if a contact was found) and a "No" path (if no contact was found).
  3. Add the Association ActionIn the "Yes" (found) branch, click the "+" icon and select the other action provided by this same 3rd-party app. It will likely be named "Associate Contact by ID" or "Associate Object."
  4. Configure the AssociationIn this new association action's settings, you will specify two things:
    • From ID (Original Contact): Set this to the contact enrolled in the workflow. Use the [Contact Record ID] token.
    • To ID (Contact to Associate): Set this to the ID you just found. Use the [search_results] token from the search action.

By completing these steps, you create a full automation: Contact A enrolls, the workflow searches for Contact B, and if B is found, the system automatically associates them. As we discussed, this action will create a standard association and does not support adding an association label (e.g., "Family" or "Referrer").

‍

Source Code

HTML
CSS
Javascript

FAQ

Is this "Contact Search Action" a standard HubSpot feature?

No, it is not. This is a custom action that becomes available by installing a third-party app called "Custom Workflow Business V2." A standard HubSpot workflow branch primarily checks conditions on the contact currently enrolled in the workflow (Contact A) (e.g., "What is Contact A's industry?"). The key difference with this action is that it can search the entire database for a different contact (Contact B) based on specific criteria (e.g., "Find Contact B who has the same company name as Contact A").

Does this one action automatically associate the found contact (Contact B) with the contact who triggered the workflow (Contact A)?

No, it does not. As emphasized in the article's "【Important】How to Use the Retrieved Record ID" section, this action's only job is to search for and find the Record ID of Contact B. To actually associate Contact B with Contact A, you must add these steps after this action: An "If/then branch" to check if a contact was found. A separate "Association Action" (likely provided by the same app) where you specify Contact A's ID and the search_results (Contact B's ID) retrieved from this action.

The video shows a static text value ("Brian") as the search criteria. Can I perform a dynamic search, like "find people who have the same company domain as Contact A (the trigger contact)"?

Yes, you can. As explained in the "Main Use Cases" (e.g., B2B contact linking), this is the primary purpose of the action. Instead of typing a fixed value like "Brian" into the Condition - Value field (Step 3), you would insert a property token from the contact enrolled in the workflow (Contact A) (e.g., the [Company Domain] token). This allows you to perform dynamic searches like "find Contact B who has the same domain as Contact A."

Search

Search more

Related Template

Need Customization?

We can customize this sample to match your specific business requirements.

Book Free Consultation

HubSpot Custom Workflow Guide: How to Auto-Search and Recommend Marketing Events

HubSpot Custom Workflow Guide: How to Auto-Recommend Files with Generative AI

HubSpot Custom Workflow Guide: How to "Search" for Marketing Campaigns and Use Their Data

HubSpot Custom Workflow Guide: How to "Search" for Tickets and Auto-Associate Contacts

HubSpot Custom Workflow Guide: How to "Search" for Deals and Auto-Associate Contacts

Company Info
Name : SweetsVillage .Inc
CEO :
‍
Tomoo Motoyama

HomeTemplateCustomWorkflow
Terms & ConditionsPrivacy PolicyContact us

Copyright ©SweetsVillage .Inc

Back To Top Image