Salesforce Winter '22 Updates to Flows

Dakota VanOs – September 15, 2021

The Developers Speak is a video series featuring certified Salesforce consultants at Digital Mass. They come to you twice a month to help bridge the gap between business problems and technical solutions.

Flows, flows, flows! It wouldn’t be a Salesforce release without updates to flows and Winter '22 is no exception! Today, Andrew is covering updates that technical admins will really enjoy, like the new features to flow builder utility, the ability to invoke subflows on specific record trigger flows, roll back updates, and invoke outbound messages from after save record triggered flows.

Transcription:

Hello everyone. Andrew Davis here, senior developer with digital mass. And today we're going to talk about another exciting subset of features to be released in the winter 22 release. If you haven't had a chance to dive into any of these features, quite yet, you can sign up for a free developer edition org with all of the winter 22 features in preview. Of course, if you have a sandbox that's already in preview mode, you can check them out there as well. Today, we're going to talk about one of my personal favorite declarative automation suites out there on the market. And that's Salesforce is a flow builder utility. There are a lot of very exciting new features being unveiled for flow builders that really help empower and embolden technical admins who are, who are building on the platform. One of these features is the ability to send external messages or call out to external services from within your flows using a new asynchronous path option that's available to you in the flow configuration interface, which is also a new feature in winter 22. So what you can now do is you can actually set an entirely separate path, a subset of actions to be executed asynchronously after a transaction commits in your after safe record triggered flows, that will allow you to do things like reach out to an external system, or submit a message in slack or teams or our post something to Heroku or maybe send some sort of commit message to an external database.

Next with flows is the ability to invoke sub-flows on both after save record triggered flows and the before delete variant on record triggered flows, this is particularly useful because there has been more traditional flows. That is the non-record-triggered flows, but then the ability to invoke sub flows that is calling another flow from your existing flow context and chain them together, taking advantage of all of the returns and things like that.
This will allow you to consolidate and compartmentalize your flow logic and allow you to keep more clean, concise declarative automation in your instance, without having to create redundant elements and things like that. But before winter 22 was released this wasn't possible with record-triggered flows, you actually had to create a lot of those same pieces of logic, even if they were shared across multiple objects. For instance, now with sub-flows, you can actually chain that together. You can consolidate all that logic and you can take advantage of what's been previously available for your standard auto launched flows.

For instance, another cool feature, with flows is the ability to roll back updates. So that's right in declared to development in apex today, you can actually set safe points in the database and roll back your transaction to a previous state in case things go awry. Well, that same functionality is now available in flows. So if, for instance, you had an update, let's say on an account where you, perhaps you inserted an account record in one of your flows, you then had a contact insert immediately thereafter intended to look up to that previously inserted account. If it's the case that the contact insert fails, perhaps you want that account record to not be created in the system. Well, before winter 22, that account record would have been created, but the contact would have failed. If you had some sort of fault handling logic in the flow, you would have been left with one account, no contact, and your flow have been resolved without having any significant errors that would have prompted the user within any disruption. Now, with this rollback behavior, you can actually extend the behavior of your fault handling to include a rollback to a previous state in the flow, allowing you to actually redact that account, insert and ensuring that that account is not created without a successful contact insert. This is very helpful for ensuring a consistent state in your database, ensuring that you have even cleaner, better-handled errors and is something that better reflects the development side of things.

Lastly, workflow rules are no longer the only source to push outbound messages to external services. That's right. You can now actually invoke outbound messages from your after saving record-triggered flows. So maybe a great excuse if ever there was a reason to continue to use workflow rules. That was certainly one of them. And now replaced that with your after save record trigger flows. After that commit happens, you can have an outbound message pushed to the service or the endpoint of your choosing with all the account information or all of the record information of your choosing using your existing configured outbound messages. That's really it that we have for flows today. We're going to be talking about Salesforce functions in the next video, looking forward to geeking out with the developers, then thanks.

About the Developer:

Meet Andrew Davis: Andrew joined the Digital Mass team as a Senior Salesforce Developer in August 2020. He came in with a few certifications on his belt and hasn't slowed down since. Andrew currently holds 10+ Salesforce certifications.

Outside of work, Andrew likes to spend his time playing D&D, camping, and burying himself in Youtube playlists exploring things ranging from emerging technologies to how to hand-sew your own socks - it’s pretty obvious he fits right in with the DM crew!