# Assistance Needed with Webhook trigger in workflow

**URL:** <https://community.hubspot.com/t/assistance-needed-with-webhook-trigger-in-workflow/109159>\
**Category:** APIs & Integrations\
**Tags:** webhooks\
**Created:** [June 11, 2024, 9:10pm UTC](https://community.hubspot.com/t/assistance-needed-with-webhook-trigger-in-workflow/109159 "2024-06-11T21:10:27Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Humashankar](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/humashankar/32/30856_2.png) [@Humashankar](https://community.hubspot.com/u/Humashankar)\
**Post date:** [June 12, 2024, 11:47am UTC](https://community.hubspot.com/t/assistance-needed-with-webhook-trigger-in-workflow/109159/4 "2024-06-12T11:47:22Z")

</div>

Hi @AliFawadHassan

Thanks for adding insight,

I get your objective which is to design a workflow that is activated by a webhook from the ABC platform, containing a distinct ID.

The workflow should then search for a matching company in HubSpot based on this ID, and either create a new company record if none exists, or update the existing record if a match is found

To overcome the limitation of requiring a pre-existing company, integrate your custom code within the workflow and this approach enables the workflow to dynamically create or update companies based on the webhook event, leveraging your custom code and the HubSpot API

- Trigger the workflow via webhook event
- Extract the unique ID from the webhook data using custom code
- Utilize the HubSpot API to search for a company with the extracted ID
- If no company is found, create a new record using the API and webhook data
- If a company is found, update the existing record using the API and new webhook data.

**Regards**

---

_[View the full topic](https://community.hubspot.com/t/assistance-needed-with-webhook-trigger-in-workflow/109159)._
