APIs & Integrations

AndriiMelnyk
Member

Trigger a workflow manually with a json object body

SOLVE

Is there a way to create a workflow with manual trigger through API call. I need to pass custom JSON object and based on the values choose which logic to follow. I already tried to look at Workflow API, Forms API. I wasn't able to find the solution, which suites my needs, I hope that it exists. The json object have two levels of nesting and can have an array as a value. 

I have a usecase: I need a way to trigger business logic in the HubSpot from external system through the API call. This workflow should be able to trigger another workflow and based on the result and passed request object select required email template, substitute values and send an email.

To send email I can use Transactional Email API - Single-send API, but in such case I need to store in my application IDs of all email templates which I need to trigger. And I'm loosing possibility to trigger other workflows and make desisions based on the result. So I'm trying to find acceptable solution for my case.

0 Upvotes
1 Accepted solution
himanshurauthan
Solution
Recognized Expert | Diamond Partner
Recognized Expert | Diamond Partner

Trigger a workflow manually with a json object body

SOLVE

Hey @AndriiMelnyk ,

To trigger another workflow from one workflow, you would need to use the type "WORKFLOW_ENROLLMENT" in the actions array and provide workflow ID and name as well.

I'm not really sure if you can select the required email template using passed request object but to simplify the process, you can create a test workflow manually based on your requirements and then get the workflow using API to check what actions should be used in your external system.

Hope it useful ! 

Thanks 
Himanshu 

Digital Marketing & Inbound Expert In Growth Hacking Technology

View solution in original post

2 Replies 2
himanshurauthan
Solution
Recognized Expert | Diamond Partner
Recognized Expert | Diamond Partner

Trigger a workflow manually with a json object body

SOLVE

Hey @AndriiMelnyk ,

To trigger another workflow from one workflow, you would need to use the type "WORKFLOW_ENROLLMENT" in the actions array and provide workflow ID and name as well.

I'm not really sure if you can select the required email template using passed request object but to simplify the process, you can create a test workflow manually based on your requirements and then get the workflow using API to check what actions should be used in your external system.

Hope it useful ! 

Thanks 
Himanshu 

Digital Marketing & Inbound Expert In Growth Hacking Technology
dennisedson
Community Manager
Community Manager

Trigger a workflow manually with a json object body

SOLVE

@AndriiMelnyk 

Welcome to the Community!

Wondering if @himanshurauthan or @Gonzalo have thoughts on this setup.

(happy holidays!)

Thanks,

Dennis




HubSpot Community Developer ShowMake sure to subscribe to our YouTube channel
where you can find the HubSpot Community Developer Show
0 Upvotes