I’m working on a client project where the mobile app is mirrored in HubSpot. We’re using several workflows to move deals through stages and to create contacts when users register directly in the app.
I need to set up a workflow where a new user/deal enters HubSpot via an API call, and then the workflow handles the next actions (stage changes, emails, etc.).
My question is:
Should the API call be used before the workflow as the entry point (i.e., API creates/updates the deal/contact, and that triggers the workflow), or it should be after the trigger? i'm a bit confused when it should start
You can configure the workflow to trigger based on: 1. Object creation a. Workflow starts when a Contact or Deal is created via the API. b. No additional property is required if all new objects should enter the workflow. 2. Custom property as a trigger a. Add a boolean or status property (e.g., integration_triggered) to Contacts or Deals. b. Your API sets this property when creating/updating the object. c. Workflow triggers only when this property is set, providing fine-grained control and preventing unintended workflow execution.
Once the workflow is triggered, it can handle all subsequent actions (stage changes, emails, tasks, etc.) as usual.
I hope this will help you out. Please mark it as Solution Accepted and upvote to help another Community member.
Hi @SRa79 , good question, this part is confusing the first time you wire an app into HubSpot.
The API call from your client’s backend is one thing, and workflow custom code is another.
For your use case, the mobile app backend should talk directly to HubSpot’s CRM APIs to create or update the contact and deal when the user registers. For example, they would POST to the contacts and deals endpoints with the user’s email, app user ID, name, plan, and whatever properties you need for routing (https://developers.hubspot.com/docs/api-reference/crm-contacts-v3/guide )
That object creation or update is what the workflow “listens” to. The workflow then starts based on an enrollment trigger like “Contact is created” or “Deal property X is known,” so it always runs after the API call, not before (https://knowledge.hubspot.com/workflows/create-workflows )
Inside the workflow, custom code actions are usually for calling your backend or another service after HubSpot has already enrolled the record, not for receiving the first payload. So your sequence is: mobile app backend sends data to HubSpot via API, HubSpot creates/updates the contact and deal, the workflow enrolls based on your trigger, then moves stages, sends emails, etc.
One small improvement is to add an integration flag property like source = mobile_app or integration_triggered = true so you can restrict the workflow to only those records. Do you want every new deal in that pipeline to enter this flow, or only app-driven ones?
When a mobile app and HubSpot both need to track the same lifecycle and revenue events, Stacksync keeps contacts and deals in two-way sync so your workflows always fire on clean, up-to-date data.
Did my answer help? Please mark it as a solution to help others find it too.
Ruben Burdin HubSpot Advisor Founder @ Stacksync Real-Time Data Sync between any CRM and Database
Hi @SRa79 , good question, this part is confusing the first time you wire an app into HubSpot.
The API call from your client’s backend is one thing, and workflow custom code is another.
For your use case, the mobile app backend should talk directly to HubSpot’s CRM APIs to create or update the contact and deal when the user registers. For example, they would POST to the contacts and deals endpoints with the user’s email, app user ID, name, plan, and whatever properties you need for routing (https://developers.hubspot.com/docs/api-reference/crm-contacts-v3/guide )
That object creation or update is what the workflow “listens” to. The workflow then starts based on an enrollment trigger like “Contact is created” or “Deal property X is known,” so it always runs after the API call, not before (https://knowledge.hubspot.com/workflows/create-workflows )
Inside the workflow, custom code actions are usually for calling your backend or another service after HubSpot has already enrolled the record, not for receiving the first payload. So your sequence is: mobile app backend sends data to HubSpot via API, HubSpot creates/updates the contact and deal, the workflow enrolls based on your trigger, then moves stages, sends emails, etc.
One small improvement is to add an integration flag property like source = mobile_app or integration_triggered = true so you can restrict the workflow to only those records. Do you want every new deal in that pipeline to enter this flow, or only app-driven ones?
When a mobile app and HubSpot both need to track the same lifecycle and revenue events, Stacksync keeps contacts and deals in two-way sync so your workflows always fire on clean, up-to-date data.
Did my answer help? Please mark it as a solution to help others find it too.
Ruben Burdin HubSpot Advisor Founder @ Stacksync Real-Time Data Sync between any CRM and Database
You can configure the workflow to trigger based on: 1. Object creation a. Workflow starts when a Contact or Deal is created via the API. b. No additional property is required if all new objects should enter the workflow. 2. Custom property as a trigger a. Add a boolean or status property (e.g., integration_triggered) to Contacts or Deals. b. Your API sets this property when creating/updating the object. c. Workflow triggers only when this property is set, providing fine-grained control and preventing unintended workflow execution.
Once the workflow is triggered, it can handle all subsequent actions (stage changes, emails, tasks, etc.) as usual.
I hope this will help you out. Please mark it as Solution Accepted and upvote to help another Community member.
Hey @kosalaindrasiri Thank you! And the API is the custom code, correct? What my client should send to me from their backend? thank you so much for your help!! just to be sure So you are saying trigger come after the custom code? Thank you so much, it's really helpful