Venn Technology


How to work around Salesforce’s 30,000 paused flow interviews using a middle-ware tool called Workato.

Recently one of our clients, with whom we are doing a Salesforce Case Management Project with, asked us to develop logic that would allow Cases to be created with certain criteria two weeks before an event starts. These particular events require multiple criteria to be completed before the registrant can attend that specific event.

The Problem

  1. Payment for the registration must be complete (they allow monthly payments).
  2. Contact information forms must be complete.
  3. “Store Credit” must either be declined or added (these events are for kids who can purchase food in the store during the event).
  4. A “stay with friends” form must not be pending (kids can attend the event with their friends).

All four of these were to be separate cases that could be created if they were not satisfied within two weeks of the event starting. So for example, you obviously can’t attend the event if you haven’t finished paying for it.

If you’ve done a fair amount of work in Workflow Rules or Process Builder, you’re probably familiar with the idea of a Timed-Based Rule or a Scheduled Action. Both of these items are what Salesforce calls “flow interviews”. The maximum number of waiting flow interviews you can have at any one point in time is 30,000. If you’re just coming up on this problem, then you’re probably already banging your head against a wall for all the work you did to meticulously create your Processes in Process Builder… and now you get to delete them (whomp, whomp…).

Oh, and by the way, if your case is anything like mine, you may not have realized that there is another limit that also causes problems. If the records in the object you’re trying to create Scheduled Actions for are created by an API that runs every night at midnight, then all of your scheduled actions are will run during that same hour whenever it executes.

This is where the execution of more than 1,000 flow interviews per hour limitation comes into play. Because all of my 30,000+ Scheduled Actions are scheduled to run at midnight, two weeks before the event starts, it will only ever execute 1,000 of those Scheduled Actions.

You’re also likely to try and figure out how you can get around these two limitations given that you still have to deliver regardless of what Salesforce says. By the way, I did connect with Partner Support and they politely told me these are “hard” limitations (i.e. we’re not changing this for you).

The Solution

Well, I’m sorry to say that for this specific case, there is no (declarative) solution in Salesforce. Even creating all four of these cases in one giant case still would create more than 30,000 waiting interviews. Obviously if you have have access to developers or can write Apex yourself, then you could potentially figure this out. At Venn Technology we’re laser focused on delivering declarative solutions as code can become outdate, stop working, break your own code, etc.

Without an simple solution in Salesforce, we turned to our favorite middle-ware tool Workato.

Workato allows your to declaratively connect different APIs to each other without writing a single line of code. It also allows you to work within a single platform to perform processes that can’t be done declaratively by the platform itself.

Using Nested Loops and Flags

In Workato we devised a simple solution to run through each Event and their related registrations. Instead of running through each Registration when it’s created or edited (in Salesforce) we individually pulled each Event then polled the Registrations tied to that event. By doing this we were able to limit the amount of registrations we looked at in our nested loop. Below is a step by step process on how to set this up in Workato.

The Nested Loops

  1. Create a new Workato Recipe and utilized the Scheduler connector. This will allow you to trigger this recipe whenever you need, i.e. nightly at midnight, once a week on Sunday, etc.
  2. Select Salesforce as your connector for the first action (and every proceeding action) so we can search for all of our Events.
  3. Our nested for loop to run through all of the Registrations for that specific Event.

The Flag

  1. After creating our case, we want to prevent the next For Loop from grabbing this record again so we flag this record by looking grabbing the Record ID.
  2. You can get it from the For Loop action you’re step is under.
  3. The flag to prevent another case from being created.

Cloning your Loops

  1. Use the clone button to create multiple Nested For Loops. This will allow you to run through thousands of records.

This entire process could take up multiple posts to go through the entire process step by step. Hopefully this overview will point you in the right direction to get your project delivered on time. If you’re in a serious time crunch, we’re always here to help and have obviously felt your pain.

Need Help?

Drop us a line to set up a free consult with one of our team members.

Dear Salesforce, It’s Me Again

You don’t get to be the #1 cloud-based CRM globally without establishing an enigmatic fanbase like Salesfore has. Some of its most diehard fans have even gone so far as to get Salesforce tattoos of the company’s logo or their favorite trailhead characters. While no one at Venn has neither confirmed nor denied getting Salesforce’s beloved Astro inked on their left bicep, one of our dedicated Salesforce Consultants penned a thoughtful (far less permanent) letter expressing his love for the world’s hottest CRM that we thought was worth sharing.

How to Set Up Einstein Search & Leverage Two of its Best Hidden Features

While we like just about every improvement Eintsein brings to Salesforce’s search—like the super fast search results, or the ability to search with phrases—one of the truly hidden gems is how quickly to you can get to related lists without even clicking a single link.

Disabling the multi-user selection in the Salesforce login screens.

I have just solved the world’s largest first world problem that very few people have. If you’re a Salesforce Consultant and you’re constantly logging into different Salesforce Production and Sandbox Orgs then you’ve likely dealt with this before. The dreaded multi-save usernames for Salesforce orgs.

Workato: How to process an unlimited amount of records

If you’ve been following the feature development that Workato has been pushing out lately then you probably know about Callable recipes. Synchronous callable recipes, at the time of this writing, have the unique ability to be included in the “transaction” that started it off. You might call 5 different recipes from one single recipe and that would all take up just 1 transaction in Workato (this is from a billing standpoint).

Sending audio files to Google Cloud for transcription via Workato

Written by Chase FriedmanOn September 11, 2017Filed in Automation | Automation | Google Cloud Platform | Salesforce | WorkatoPretty much everyone knows what Speech-to-Text is these days. You likely use it all the time with your phone to transcribe your voice to text...

How to work around Salesforce’s 30,000 paused flow interviews using a middle-ware tool called Workato.

Recently one of our clients, with whom we are doing a Salesforce Case Management Project with, asked us to develop logic that would allow Cases to be created with certain criteria two weeks before an event starts. These particular events require multiple criteria to...

Planning for Your Salesforce to Intacct Integration – Questions for SMBs & Nonprofits

This is article #2 in Venn Technology's 3 part Salesforce and Intacct Integration series. Read article #1 here.   If you're reading this post you are most likely already aware of the myriad benefits integration has for small to medium sized businesses and...

Salesforce and Intacct: The Secret to the Perfect Sync

  Salesforce and Intacct are powerful tools for any SMB or non-profit arsenal - I’ve seen them in action at the amazing organizations we advise here at Venn Technology and the advantage is vast. But it takes more than just adapting the software, you have to know...

Dreamforce 2015 – Top Takeaways

Dreamforce keeps getting bigger and better.  DF '15 was no exception.  Here are the things we at Venn Technology found to be the biggest takeaways. WHOA! This marked my fifth time to attend Dreamforce.  There were 40,000 people at my first DF.  Prior to that the...

What is the new Salesforce?

The New Salesforce Unless you have been hiding under a rock you have probably heard at least a little bit about "The New Salesforce" but may not know exactly what that means. On the surface some might say that "The New Salesforce" is simply a new user interface....

Scheduled Actions in Salesforce Using Workato

Have you ever wanted to create scheduled actions in Salesforce? Time Based Workflow vs. Schedules Let me start with saying that Time Based Workflow is a great tool.  It allows you to do things like schedule a follow-up task two days after the creation of a new Lead or...

Unwanted Email Attachments & Salesforce

How to handle unwanted email attachments in Salesforce In the course of just a few days two clients on one of our support plans have contacted us about how to handle unwanted email attachments in Salesforce.  You know the ones I'm talking about, the company logo and...

While you’re at it: