Last Updated on February 10, 2022 by Rakesh Gupta
Big Idea or Enduring Question:
How do you automatically submit a record for approval using Salesforce Flow?
Objectives:
After reading this article, you’ll be able to:
- Use After-save Record-Triggered Flow to automatically submit the record into the approval
- How to create an Approval process
Business Use case
Warren Mason is working as a System Administrator at Universal Containers (UC). He has created an approval process on the Campaign object. This will work only for those campaigns where the Budgeted Cost is greater than $1M. Now he is looking for a way so that the campaign record will be automatically submitted into the approval process without any manual intervention when it meets the entry criteria.
Automation Champion Approach (I-do):
Let’s begin building this automation process.
Guided Practice (We-do):
There are 2 steps to solve Warren’s business requirement using Salesforce Flow. We must:
- Create an approval process
- Salesforce Flow
- Define flow properties for record-triggered flow and check the budget
- Use action to submit the record to the approval process
Step 1: Create an Approval Process
- Click Setup.
- In the Quick Find box, type Approval Processes.
- Clicks on the Create New Approval Process | Use Standard Setup Wizard button.
- Select the Campaign object for Manage Approval Processes For drop-down.
- Now create an approval process, as shown in the following screenshot:
Step 2.1: Salesforce Flow – Define Flow Properties
As we have a requirement for submitting the record into the approval process, this is why we have to use the After-save flow.
- Click Setup.
- In the Quick Find box, type Flows.
- Select Flows then click on the New Flow.
- Select the Record-Triggered Flow option and click on Next and configure the flow as follows:
- Object: Campaign
- Select All Condition Are Met (AND).
- Set Conditions
- Row 1
- Field: Campaign | IsActive
- Operator: Equals
- Value: {!$GlobalConstant.True}
- Click Add Condition
- Row 2
- Field: Campaign | Budgeted Cost in Campaign
- Operator: Greater Than
- Value: 1000000
- Row 1
- Select Only when a record is updated to meet the condition requirements.
- Click Done.
Step 2.2: Salesforce Flow – Call an Acton – Submit Record for Approval
The next step is to submit the campaign record for approval. For this, we will call the SUbmit for Approval core action.
- Under Toolbox, select Element.
- Drag-and-drop Action element onto the Flow designer.
- In the Action box, type Submit for Approval.
- Clicks on the Submit for Approval Core action.
- Set Input Values:
- Record ID: {!$Record.Id}
- Approval Process Name Or ID: Campaign_budget_greater_than_1M
- Submission Comments: Auto Submitted through Flow
- Click Done.
In the end, Warren’s Flow will look like the following screenshot:
- Click Save.
- Enter Flow Label the API Name will auto-populate.
- Click Show Advanced.
- Type: Record-Triggered Flow
- API Version for Running the Flow: 51
- Interview Label: Submit campaign for Approval {!$Flow.CurrentDateTime}
- Click Save.
Almost there! Once everything looks good, click the Activate button.
A few key details to remember
- When defining the Approval Steps, if you have selected Let the submitter choose the approver manually option (Step 3: Select Assigned Approver ), then Process Builder will not work. You will get a runtime error (i.e., No applicable approval process found).
- The record is submitted to the default approval process, and there are no active approval processes for the record’s object type.
- The record is submitted to the default approval process, and it doesn’t meet the criteria for any of the approval processes for the record’s object type.
- The record is submitted to a specific approval process, and it doesn’t meet the entry criteria.
Proof of Concept
Now onwards, if a business user creates a campaign with a budget amount greater than $1M and makes it active, then Salesforce Flow will automatically trigger and submit the record for the approval process.
Formative Assessment:
I want to hear from you!
What is one thing you learned from this post? How do you envision applying this new knowledge in the real world?
Let me know by Tweeting me at @automationchamp, or find me on LinkedIn.
Hello !
Fantastic article, thank you for publishing it.
I am struggling with the step Step 2.2 -> Click Show Advanced.
Maybe Salesforce Flow was changed, but I can not find such option in the Action section of the flow.
Can you please advice.
No, the name is still the same. Please check this help article.
This is wonderful, but I’m getting the following error message when I debug the flow: No applicable approval process was found.
Is there a possibility you created the approval process but don’t have it activated? Does your record meet the entry criteria for your approval process? This error is thrown when a user is attempted to be submitted for approval and no approval process can be found, either because it isn’t activated or your object doesn’t meet the entry criteria.
Hello Rakesh This blog help me very much but there is one issue while we add immediate action as submit for Approval and try to add approval flow that flow is not visible to be .Please help me to resolve this issue . Thanks a lot in advance
Can you please explain the issue in detail?
Any chance we can make requests to see you do this with the new lightning flow? I would like to kick off a flow to determine which approval process it enters based off of profiles and criteria. I am a little lost and know that this is a great solution if I could just get it right one time.
Hi Rakesh,
This is really great and you made it easy.
However i get an error message on the record and it says: “The record couldn’t be saved because it failed to trigger a flow. A flow trigger failed to execute the flow with version ID 30128000000JTrS. Contact your administrator for help.”
When i tried to search something on this error – i found that this is a known issue. Is that so? If so, any alternate solution for this?
Thanks for your help!!!
Use Debug log to identify the route cause.
Hello sir..
thanks for this article. it’s really helpful. but i am not getting “flow trigger” action in workflow rule.will you please tell me how can i do that. from where to contact salesforce to enable this for me.
Use Process Builder to auto submit record into approval process instead of workflow rule
Hi Rakesh,
This is a wonderful tutorial! It has helped me immensely! I built out this flow and approval process but each time I save a new Opportunity I get the message “Wrokflow Action Failed to Trigger Flow. The record couldn’t be saved because it failed to trigger a flow…”
Can you please post or email me your Flow and Process Screenshots ?
Hi Rakesh,
Thank you for the great tutorial.
Just wondering though if it is also possible to view the Submit for Approval button for the ServiceDesk Staff or it just available for the Admin?
Looking forward for your response! 🙂
Thank you in advance! 🙂
Please check out this KA https://help.salesforce.com/apex/HTViewSolution?id=000176351&language=en_US
Hi Rakesh,
We have used the auto submit for several months now and it works fine, except when the second approver has rejected the request…… When the project is rejected, edited and saved again, we would like to have it auto submitted again. At this moment we have to click the button “submit for approval”.
Could you please advice me?
Yes it’s possible to auto submit again after rejection, but I didn’t get what is means of edited and saved ?
Hi, That’s exactly what I ment.
Rejected, and after that auto submit. At the moment we have to click the button ” submit for approval”.
I’m assuming you are updating the record status to Rejected (In my case i.e. Excluded) after final rejection if yes, then you have to modify the Process Criteria. Add Rejected (In my case i.e. Excluded) to the Process criteria as shown in the following screenshot
https://rakeshistom.files.wordpress.com/2015/03/process-criteria-for-rejection.png
I just wanted to say thanks! Worked perfectly for me and opened my eyes to the wonder of headless flows.
Glad to know that! 🙂
To call a Flow from Process Builder, please follow the below instructions
1) Navigate to Setup | Build | Create | Workflow & Approvals | Process Builder and click on the New button to create new Process
2) Enter the Process Name, Description and API Name, Once done click on Save button as shown in the following screenshot
https://rakeshistom.files.wordpress.com/2015/02/prcoess-builder.png
3) Now Click on Object then Select the Opportunity Object and Evaluation Criteria for Process, as shown in the following screenshot
https://rakeshistom.files.wordpress.com/2015/02/add-evaluation-criteria.png
Once done click on Save button
4) Next step is to add Process Criteria, To do that Click on Add Criteria, Please refer to the following screenshot for more details
https://rakeshistom.files.wordpress.com/2015/02/process-criteria1.png
Once done click on Save button.
5) Next task is to add one Immediate Actions i.e. Launch a Flow, Please refer to the following screenshot for more details
https://rakeshistom.files.wordpress.com/2015/02/add-immediate-actions.png
Once done click on Save button.
6) Finally your Process will look like the following screenshot
https://rakeshistom.files.wordpress.com/2015/02/auto-submit-into-approval.png
7) Activate the Process. After you activate a process, you can no longer edit that process
Hi Rakesh,
Thanks a lot for the post.
I am also getting the same error mentioned above by Carola.
‘When I click on “run” it says “your flow doesn’t have a start element”
Please suggest me what to do.
You have to set the start point in your Flow. Please see the step 5 carefully, you can see green arrow (like wise you have to set start point in your flow).
Thanks a lot Rakesh.
You mentioned about one error in consideration.
In my approval step, approvers are added automatically (two static users). But still am getting same error when the entry criteria or process step criteria does not meet.
Can you please help.
What kind of error you are getting ?
I don’t have the ability to use flow with an immediate WorkFlow action. Flows has been enabled for my sandbox org. What could I be doing wrong? Are there any input/output definitions I need to set on the Flow canvas?
Could you please post a screenshot ?
Hi,
Am using a Developer org and it is upgraded to Winter 15. But I don’t see the option “New Flow Trigger” under “Workflow and Approval Process”, although able to create the Flows.
Can you help me with information on enabling it on Dev org. Thanks
Hi Manju,
This feature is still under pilot program #safeharbor. If your organization wants to enable this feature ask your Account executive to contact Salesforce.com support.
Rakesh
Thanks Rakesh for your response.
I understand we have a AE for non-Dev orgs. For the Dev orgs, whom should we reach out to? Is there any support site where we request the feature to be enabled to?
Thansk again. – Manju
No, Salesforce Stops Supporting for Developer Editions. The good news is after spring’15 release Process Builder is going GA.
I don’t have the ability to use flow with an immediate WorkFlow action. Is there another option to call the flow?
-WorkFlow action using the outbound message?
-Custom button using the flow url?
Outbound message seems like it would be my preference.
Thanks,
Jay
To enable this feature (call Flow through WFR) you have to raise a case with Salesforce.com support. Meanwhile there are other ways to call the Flow is using custom button, custom url or through VF pages.
Hi rakesh,
Thanks, I saw that in a earlier comment of yours, so I’ve done that already.
Still I don’t see the fields to select name and value ( I see them in your second screen).
Could you please post the screenshot with your requirment
I’m one step further. Created the workflow, activated it, but i receive an erro:
workflow action failed etc.
So I went to check out the flow and whe n I click on “run” it says “your flow doesn’t have a start element.
I can’t insert print screens in this comment field. I have put them into a word doc, but I don’t see anything to upload them…do yoy have an email address?
You have to set the start point in your Flow. For more detail please check your email
Hi Rakesh,
I was very happy to read your blog, because it can save my collegues thousands of mouseclicks.
I want to use it for submitting our custom object “project”, after it has been edited and saved, automatically into the approval process.
When I create a workflow I don’t have the option to select “new flow trigger”.
Could you please help me with that?
I’m testing in our sandbox, which is already at Winter’15
Hope you can help me out.
Thanks,
Carola
Hi Carola,
This feature is still under the pilot program. Ask your account executive to get in touch with Salesforce.com support to enable this feature for your org.
Thanks,
Rakesh
Hi Rakesh,
Salesforce has enabled this feature in my org. That’s really great, but still I’m doning someting wrong.
I have made the flow, with the variable which I have created. Does the variable need to be input, output or input/output? Does it have a defalut value or just blank?
After that I have made a workflow. At the step “immediate workflow actions” I’m able to select “new flow trigger” but I dont’ see the field where you can set the flow variable…..
Or do I have to choose for excisting action? but then I can’t choose a flow trigger.
Many many thanks for you help.
Hi Carola,
You have to set Variable Input/Output Type = Input and Output. As shown in the following screenshot
https://rakeshistom.files.wordpress.com/2014/09/submi-for-approval3.png
Regards,
Rakesh
Hi Rakesh,
I am trying to create a flow to automatically submit a Contract record into the approval process. I got added to the pilot program and the static action is there. However I dont have the option to set the flow variables in my workflow trigger. I am not sure if I created the flow correctly. In the above blog you say to ‘Create One text type variable RecordID (to pass a record ID from workflow via Flow Trigger).’ Can you provide the exact steps to do that as I might not be doing that correctly.
Thanks,
Kristen
Hi Kristen,
You have to set Variable Input/Output Type = Input and Output, for more info please see the below Screenshot
https://rakeshistom.files.wordpress.com/2014/09/submi-for-approval3.png
Regards,
Rakesh
I see that you can add an approval element in Flow in the coming Winter ’15 release. Is the workflow immediate action to run a flow also available in Winter ’15? I don’t see that option in my Workflows.
You are right submitting for Approval static action in Flow in the coming Winter ’15 release. No it’s still under Pilot program but they can be triggered via Apex.
HI Rakesh,
Could please share the video of this tutorial ? I dont see static action for Submit For Approval in Flow .
It would be great help if you like to share further on this . Thanks in advace.
Abrar.
Hi Abrar,
This feature under pilot program #safeharbor. If your organization wants to use this feature ask your Account executive to contact Salesforce.com support.
Thanks Rakesh, Could you please share a video tutorial for this .
Sure, give me few days. Thanks Abrar!
where can i find the static action for submit for approval .. cannot see it in the flows
Which Salesforce instance you are referring ? Please make sure you Salesforce org upgraded to summer’14 and this feature under pilot program.
Hi Rakesh,
Thank you for all your great tutorial and effort to share with us. I am not able to follow this as screen shot, can you make video tut for this plz.
Thanks Ammy for your suggestion, I will try to post video soon.
That’ll be awesome, you should make quick steps video for all your posts as you already have the detail explanation in the post. Is there anyway to contact you personally.?
Check your Inbox.