Migrate to Flow Tool:
Salesforce has announced that they are going to deprecate (retire) workflows and process builders in future. So, they released a tool called Migrate to flow to convert existing workflows into flows.
Setup → Process Automation → Migrate to Flow
In Migrate to flow, we can see the existing workflows with objects and their status (Active/Inactive). By clicking Migrate to flow option, we can convert a workflow into flow.
Once workflow is converted to flow, it will display a component with a new flow name and options to open flow and activate it.
The converted flow name will be same as the workflow name and the description of newly migrated flow will also be created.
We can use the Switch Activations button in the popup to activate the new flow and deactivate the existing workflow.
The ‘Migrate to flow’ tool cannot convert workflow to flow if it has,
- Cross object field update
- Criteria with no defined workflow actions
- Global variable fields
- Fields on related records
- Record types
- It does not contain, includes, excludes, or within operators.
- The greater than, greater or equal to, less than, less or equal to operators on picklist fields
- Formulas that use Hour, Minute, Second, Time Now, Time Value, Is Clone, or $Record Type
- Relative date values in date fields
- Multiple currencies
Test One, Two, Three, Flow (Generally Available)
Flow debugging is available in record-triggered flow (In Summer’22) and scheduled path flow (In Winter’23 release) as of now. We can test the flows with different scenarios before activating it.
Scenario: Updating contact’s email with account email, once after contact is mapped with account.
Creating a Flow:
Setup → flow → New flow → triggering object (Contact)
Add a Decision element to check whether the contact has mapped the account.
If a contact is mapped with account, then check for account email and update the contact’s email with account email.
Create Test: Flow → view Tests (Beta) → Create.
Enter the name for the test and select when the test should run (Created or updated) and select the triggering record in the next section (Set Initial Triggering Record).
Create assertions in the next section with custom failure message.
To run tests: Flow → View Tests (Beta) → select Run Test and View Details
Test run details with Assertions
Assertion 1: Checks whether the decision element was visited.
Assertion 2: Evaluates contact associated with Account.
Assertion 3: Verifies account has an email.
For Test Case 1 (Positive)
For Test Case 2 (Negative)
Test case 2 failed because there is no account related to the contact in that test case.
Flow is one of the powerful tools for process automation in the future. So, it is one of the best practices to check the behaviors of flow before activating it with different scenarios.
Using debug flow option requires configuring the test parameters each time; whereas with flow test, the test parameters can be configured once.
Limitations and considerations (References):