Salesforce Visual Workflow has made the life of admins so much easier, with the simplicity to integrate and interconnect business processes without thousands of lines of code. To take this one step further, we’ve put together a plugin which allows you to send data using a plugin from Salesforce Visual Workflow through a POST JSON webhook to any 3rd party service (such as Zapier). While it is extremely simply in its design, it is a huge advantage to be able to move data between business systems without the need to spend hours developing your own connectors.
Implementation Time: 15 Minutes
- Salesforce Edition with ‘Visual Flow’ (Pro/Enterprise)
- Zapier or other 3rd party webhook endpoint
Install the Salesforce Package:
The package we have created is comprised of a single APEX Class which creates the plugin inside Salesforce Visual Workflow.
- Click the following link to Install the unmanaged package
- If everything is correctly installed, you should be able to see the new plugin when you open up a new or existing flow.
Add a remote site:
Before any web service calls can be made, Salesforce Remote Sites must be configured to allow for outbound communication to send the POST request. In our particular case we are using Zapier, so we will add the Zapier hooks URL to our remote sites configuration.
- Inside Salesforce navigate to Setup > Security Controls > Remote Site Settings
- Click on New Remote Site
- Add in the domain for your endpoint. In the example below you can see we are using Zapier (https://hooks.zapier.com).
Test out your Webhook
The plugin has been set with 15 variables, but you can always modify the code to add more if you need it.
- Open a new or existing Visual Workflow inside Salesforce.
- Drag the HTTP POST Plugin element onto your canvas and configure the variables you want.
- The PostURL should be your Zapier endpoint url
- The Var‘s which are listing below can be populated with any variables or static variables like you can see below.
(Optional) If you’re using Zapier, setup a Webook Trigger like the below which will catch the variables when you post them.
As I’m not an APEX/SF developer, the code is not perfect, but works extremely well to get data out of Salesforce Visual Workflow. If there are any developers out there I would love to hear your two cents and offer any form of improvement to this!