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.
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.
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.