One of the key feature of Salesforce environment is process automation. We have basically four types of automation tool in it:-
1) Process builder
4) Visual workflows
In this post we will be discussing visual workflows
Q) What is the difference between workflows and visual workflows ?
While Workflows are mainly triggered by events, Visual Workflows are triggered by user actions.A workflow is defined on only one object whereas there is no such limitation for visual workflow. For more detailed differences between the two, please refer this help page
Q) When to use it ?
If you have a requirement in which you need the customer to input some data and then doing something with it , visual workflow is the right answer for you.
Important Note: If you can achieve the functionality with the use of process builder , then that is the recommended way to go, because of its easier to understand UI. The moment you need user input in the process, visual workflow comes into play.
Q) Where can i create a new visual workflow in my org ?
You need to go to setup -> Create -> Workflow and Approvals -> Flows
Then click on new flow .
Q) What is a cloud flow designer ?
It is the tool used to design flows.
In short, Visual Workflow is the product name, Cloud Flow Designer is the tool, and flows are the thing that you create.
Q) Which edition and user permissions are needed to run and create visual workflows ?
Available in: Enterprise,Performance, Unlimited, and Developer Editions
User Permissions for running: The user must have either the “Run Flows” user permission or Force.com Flow User selected on their user record
User Permissions for creating: Manage Force.com Flow
Now let’s create a visual workflow which will create a new Account record on user input
When you click on the create new flow the below page is what you see. This is the cloud flow designer it is divided into 3 parts
- Button bar
It is used to manage the flow you are designing
- The left-side panel
It contains three tabs (i) Palette – Contains all the element you can add to the flow
(ii)Resources – Contains all the resources you can add onto your flow
(iii)Explorer – shows all of the elements and resources that you’ve already added to this flow
The flow you design will appear here
Step 1 : Add a screen from palette (drag and drop on the canvas) to collect information from user .
In General Info tab add a name to this screen , and in Add a Field tab add the fields on the preview pane for which you require user input.
Step 2: Add a Record Create element from palette to the canvas , give it a name and map the fields of Account object to the screen input fields you just created
Important Note: Make sure that you include all the required fields needed for that object on the screen , otherwise new record won’t get created
Step 3: Connect the screen and record creation element with the help of connectors ( Just drag the connector from Screen to record creation element) .
And assign the screen as the first element of the flow by clicking on the green arrow on the screen element. Your flow would be looking something like this :
Save your flow by giving it an appropriate name.
Important Note: A flow can consist of multiple flow versions. Once you’ve activated a flow, you can’t make changes to it. You can, however, make the necessary changes to a new version of that flow and later activate the new version.
Step 4: For embedding your flow in a visualforce page you need to add the unique name of your flow in the below code
<apex:page> <flow:interview name = "YOUR_FLOW" /> </apex:page>
Your page would be looking something like this .
Now your flow is ready to be distributed to the users
Note: Make sure the users that are going to use this flow have all the necessary permissions in addition to access to this visualforce page
Limits and Considerations for Visual Workflow :
While designing visual workflow please make sure that you are not hitting the flow limits, following are the few flow limits you might need to keep an eye on:-
|Maximum number of versions per flow||50|
|Maximum number of flows and processes per organization||1000|
For a more detailed list of limits on visual workflow you may want to go this help page