Trigger a Single Flow

This function is used to call a single flow by its ID.   This type of Flow would typically be created with a "Manual" trigger type which can then be started through calls such as this one. 

Syntax

flows.RunSingleFlow(<FlowId>, <Payload>, <Callback>)
ParameterDescription
Flow IDThe ID of the flow to call.  This can be found on the Flows Properties panel in the Flow Builder
PayloadThe JSON payload to pass to the flow.  This could contain any fields that you define and will be automatically parsed by Flows so that the field values can be used within the flow.
CallbackAn optional callback function that will be called with the result once the call to Flows is complete 

 

Example

<script>
var flowId = "W3-dasdf-123";
var payload = Object();
payload['user_id'] = '123';
payload['page_visited'] = 'deposit';

flows.RunSingleFlow(flowId, payload, function(response) {
    console.log(response);
});
</script>