Skip to content

Instantly share code, notes, and snippets.

@osieckiAdam
Last active March 4, 2025 19:32
Show Gist options
  • Save osieckiAdam/32e3ad91973135b01283512985bb0cda to your computer and use it in GitHub Desktop.
Save osieckiAdam/32e3ad91973135b01283512985bb0cda to your computer and use it in GitHub Desktop.
Bulkification in Flows - code for blog article
<?xml version="1.0" encoding="UTF-8"?>
<Flow xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>63.0</apiVersion>
<assignments>
<name>Some_logic_for_setting_general_values</name>
<label>Some logic for setting general values</label>
<locationX>176</locationX>
<locationY>323</locationY>
<assignmentItems>
<assignToReference>Task_Record_To_Insert.IsHighPriority</assignToReference>
<operator>Assign</operator>
<value>
<booleanValue>false</booleanValue>
</value>
</assignmentItems>
<connector>
<targetReference>Some_logic_for_setting_values_on_first_task</targetReference>
</connector>
</assignments>
<assignments>
<name>Some_logic_for_setting_values_on_first_task</name>
<label>Some logic for setting values on first task</label>
<locationX>176</locationX>
<locationY>431</locationY>
<assignmentItems>
<assignToReference>Task_Record_To_Insert.AccountId</assignToReference>
<operator>Assign</operator>
<value>
<elementReference>$Record.Id</elementReference>
</value>
</assignmentItems>
<assignmentItems>
<assignToReference>Task_Record_To_Insert.Subject</assignToReference>
<operator>Assign</operator>
<value>
<stringValue>&quot;First Task&quot;</stringValue>
</value>
</assignmentItems>
<connector>
<targetReference>Create_First_Task</targetReference>
</connector>
</assignments>
<assignments>
<name>Some_logic_for_setting_values_on_second_task</name>
<label>Some logic for setting values on second task</label>
<locationX>176</locationX>
<locationY>647</locationY>
<assignmentItems>
<assignToReference>Another_Task_Record_To_Insert.AccountId</assignToReference>
<operator>Assign</operator>
<value>
<elementReference>$Record.Id</elementReference>
</value>
</assignmentItems>
<assignmentItems>
<assignToReference>Another_Task_Record_To_Insert.Subject</assignToReference>
<operator>Assign</operator>
<value>
<stringValue>&quot;Second Task&quot;</stringValue>
</value>
</assignmentItems>
<connector>
<targetReference>Create_second_Task</targetReference>
</connector>
</assignments>
<environments>Default</environments>
<interviewLabel>Antipattern 1 {!$Flow.CurrentDateTime}</interviewLabel>
<label>Antipattern 1</label>
<processMetadataValues>
<name>BuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>CanvasMode</name>
<value>
<stringValue>AUTO_LAYOUT_CANVAS</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>OriginBuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processType>AutoLaunchedFlow</processType>
<recordCreates>
<name>Create_First_Task</name>
<label>Create First Task</label>
<locationX>176</locationX>
<locationY>539</locationY>
<connector>
<targetReference>Some_logic_for_setting_values_on_second_task</targetReference>
</connector>
<inputReference>Task_Record_To_Insert</inputReference>
</recordCreates>
<recordCreates>
<name>Create_second_Task</name>
<label>Create second Task</label>
<locationX>176</locationX>
<locationY>755</locationY>
<inputReference>Task_To_Insert</inputReference>
</recordCreates>
<start>
<locationX>50</locationX>
<locationY>0</locationY>
<connector>
<targetReference>Some_logic_for_setting_general_values</targetReference>
</connector>
<object>Account</object>
<recordTriggerType>Create</recordTriggerType>
<triggerType>RecordAfterSave</triggerType>
</start>
<status>Obsolete</status>
<variables>
<name>Another_Task_Record_To_Insert</name>
<dataType>SObject</dataType>
<isCollection>false</isCollection>
<isInput>false</isInput>
<isOutput>false</isOutput>
<objectType>Task</objectType>
</variables>
<variables>
<name>Task_Record_To_Insert</name>
<dataType>SObject</dataType>
<isCollection>false</isCollection>
<isInput>false</isInput>
<isOutput>false</isOutput>
<objectType>Task</objectType>
</variables>
<variables>
<name>Task_To_Insert</name>
<dataType>SObject</dataType>
<isCollection>true</isCollection>
<isInput>false</isInput>
<isOutput>false</isOutput>
<objectType>Task</objectType>
</variables>
</Flow>
<?xml version="1.0" encoding="UTF-8"?>
<Flow xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>63.0</apiVersion>
<assignments>
<name>Some_logic_for_setting_values_on_first_task</name>
<label>Some logic for setting values on both tasks</label>
<locationX>176</locationX>
<locationY>323</locationY>
<assignmentItems>
<assignToReference>Task_Record_To_Insert.AccountId</assignToReference>
<operator>Assign</operator>
<value>
<elementReference>$Record.Id</elementReference>
</value>
</assignmentItems>
<assignmentItems>
<assignToReference>Task_Record_To_Insert.Subject</assignToReference>
<operator>Assign</operator>
<value>
<stringValue>&quot;First Task&quot;</stringValue>
</value>
</assignmentItems>
<assignmentItems>
<assignToReference>Another_Task_Record_To_Insert.AccountId</assignToReference>
<operator>Assign</operator>
<value>
<elementReference>$Record.Id</elementReference>
</value>
</assignmentItems>
<assignmentItems>
<assignToReference>Another_Task_Record_To_Insert.Subject</assignToReference>
<operator>Assign</operator>
<value>
<stringValue>&quot;Second Task&quot;</stringValue>
</value>
</assignmentItems>
<assignmentItems>
<assignToReference>Tasks_To_Insert</assignToReference>
<operator>Add</operator>
<value>
<elementReference>Task_Record_To_Insert</elementReference>
</value>
</assignmentItems>
<assignmentItems>
<assignToReference>Tasks_To_Insert</assignToReference>
<operator>Add</operator>
<value>
<elementReference>Another_Task_Record_To_Insert</elementReference>
</value>
</assignmentItems>
<connector>
<targetReference>Create_Tasks</targetReference>
</connector>
</assignments>
<environments>Default</environments>
<interviewLabel>Antipattern 1 Fixed {!$Flow.CurrentDateTime}</interviewLabel>
<label>Antipattern 1 Fixed</label>
<processMetadataValues>
<name>BuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>CanvasMode</name>
<value>
<stringValue>AUTO_LAYOUT_CANVAS</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>OriginBuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processType>AutoLaunchedFlow</processType>
<recordCreates>
<name>Create_Tasks</name>
<label>Create Tasks</label>
<locationX>176</locationX>
<locationY>431</locationY>
<inputReference>Tasks_To_Insert</inputReference>
</recordCreates>
<start>
<locationX>50</locationX>
<locationY>0</locationY>
<connector>
<targetReference>Some_logic_for_setting_values_on_first_task</targetReference>
</connector>
<object>Account</object>
<recordTriggerType>Create</recordTriggerType>
<triggerType>RecordAfterSave</triggerType>
</start>
<status>Active</status>
<variables>
<name>Another_Task_Record_To_Insert</name>
<dataType>SObject</dataType>
<isCollection>false</isCollection>
<isInput>false</isInput>
<isOutput>false</isOutput>
<objectType>Task</objectType>
</variables>
<variables>
<name>Task_Record_To_Insert</name>
<dataType>SObject</dataType>
<isCollection>false</isCollection>
<isInput>false</isInput>
<isOutput>false</isOutput>
<objectType>Task</objectType>
</variables>
<variables>
<name>Tasks_To_Insert</name>
<dataType>SObject</dataType>
<isCollection>true</isCollection>
<isInput>false</isInput>
<isOutput>false</isOutput>
<objectType>Task</objectType>
</variables>
</Flow>
<?xml version="1.0" encoding="UTF-8"?>
<Flow xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>63.0</apiVersion>
<environments>Default</environments>
<interviewLabel>Antipattern 2 {!$Flow.CurrentDateTime}</interviewLabel>
<label>Antipattern 2</label>
<loops>
<name>Loop_through_the_contacts</name>
<label>Loop through the contacts</label>
<locationX>176</locationX>
<locationY>431</locationY>
<collectionReference>Get_all_contact_related_to_account</collectionReference>
<iterationOrder>Asc</iterationOrder>
<nextValueConnector>
<targetReference>Get_all_Tasks_related_to_Contacts</targetReference>
</nextValueConnector>
</loops>
<loops>
<name>Loop_through_the_tasks</name>
<label>Loop through the tasks</label>
<locationX>352</locationX>
<locationY>647</locationY>
<collectionReference>Get_all_Tasks_related_to_Contacts</collectionReference>
<iterationOrder>Asc</iterationOrder>
<nextValueConnector>
<targetReference>Delete_Task</targetReference>
</nextValueConnector>
<noMoreValuesConnector>
<targetReference>Loop_through_the_contacts</targetReference>
</noMoreValuesConnector>
</loops>
<processMetadataValues>
<name>BuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>CanvasMode</name>
<value>
<stringValue>AUTO_LAYOUT_CANVAS</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>OriginBuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processType>AutoLaunchedFlow</processType>
<recordDeletes>
<name>Delete_Task</name>
<label>Delete Task</label>
<locationX>440</locationX>
<locationY>755</locationY>
<connector>
<targetReference>Loop_through_the_tasks</targetReference>
</connector>
<inputReference>Loop_through_the_tasks</inputReference>
</recordDeletes>
<recordLookups>
<name>Get_all_contact_related_to_account</name>
<label>Get all contact related to account</label>
<locationX>176</locationX>
<locationY>323</locationY>
<assignNullValuesIfNoRecordsFound>false</assignNullValuesIfNoRecordsFound>
<connector>
<targetReference>Loop_through_the_contacts</targetReference>
</connector>
<filterLogic>and</filterLogic>
<filters>
<field>AccountId</field>
<operator>EqualTo</operator>
<value>
<elementReference>$Record.Id</elementReference>
</value>
</filters>
<getFirstRecordOnly>false</getFirstRecordOnly>
<object>Contact</object>
<storeOutputAutomatically>true</storeOutputAutomatically>
</recordLookups>
<recordLookups>
<name>Get_all_Tasks_related_to_Contacts</name>
<label>Get all Tasks related to Contacts</label>
<locationX>352</locationX>
<locationY>539</locationY>
<assignNullValuesIfNoRecordsFound>false</assignNullValuesIfNoRecordsFound>
<connector>
<targetReference>Loop_through_the_tasks</targetReference>
</connector>
<filterLogic>and</filterLogic>
<filters>
<field>WhoId</field>
<operator>EqualTo</operator>
<value>
<elementReference>Loop_through_the_contacts.Id</elementReference>
</value>
</filters>
<getFirstRecordOnly>false</getFirstRecordOnly>
<object>Task</object>
<storeOutputAutomatically>true</storeOutputAutomatically>
</recordLookups>
<start>
<locationX>50</locationX>
<locationY>0</locationY>
<connector>
<targetReference>Get_all_contact_related_to_account</targetReference>
</connector>
<doesRequireRecordChangedToMeetCriteria>true</doesRequireRecordChangedToMeetCriteria>
<filterLogic>and</filterLogic>
<filters>
<field>CleanStatus</field>
<operator>EqualTo</operator>
<value>
<stringValue>Inactive</stringValue>
</value>
</filters>
<object>Account</object>
<recordTriggerType>Update</recordTriggerType>
<triggerType>RecordAfterSave</triggerType>
</start>
<status>Obsolete</status>
</Flow>
<?xml version="1.0" encoding="UTF-8"?>
<Flow xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>63.0</apiVersion>
<assignments>
<name>Add_Contact_Id_to_the_list</name>
<label>Add Contact Id to the list</label>
<locationX>270</locationX>
<locationY>539</locationY>
<assignmentItems>
<assignToReference>ContactIds</assignToReference>
<operator>Add</operator>
<value>
<elementReference>Loop_through_the_contacts.Id</elementReference>
</value>
</assignmentItems>
<connector>
<targetReference>Loop_through_the_contacts</targetReference>
</connector>
</assignments>
<decisions>
<name>Any_records_to_delete_found</name>
<label>Any records to delete found?</label>
<locationX>182</locationX>
<locationY>839</locationY>
<defaultConnectorLabel>Default Outcome</defaultConnectorLabel>
<rules>
<name>Yes</name>
<conditionLogic>and</conditionLogic>
<conditions>
<leftValueReference>Get_all_Tasks_related_to_Contacts</leftValueReference>
<operator>IsNull</operator>
<rightValue>
<booleanValue>false</booleanValue>
</rightValue>
</conditions>
<connector>
<targetReference>Delete_all_Tasks_related_to_Contacts</targetReference>
</connector>
<label>Yes</label>
</rules>
</decisions>
<description>Solution for antipattern 2</description>
<environments>Default</environments>
<interviewLabel>Antipattern 2 - Fix {!$Flow.CurrentDateTime}</interviewLabel>
<label>Antipattern 2 - Fix</label>
<loops>
<name>Loop_through_the_contacts</name>
<label>Loop through the contacts</label>
<locationX>182</locationX>
<locationY>431</locationY>
<collectionReference>Get_all_contact_related_to_account</collectionReference>
<iterationOrder>Asc</iterationOrder>
<nextValueConnector>
<targetReference>Add_Contact_Id_to_the_list</targetReference>
</nextValueConnector>
<noMoreValuesConnector>
<targetReference>Get_all_Tasks_related_to_Contacts</targetReference>
</noMoreValuesConnector>
</loops>
<processMetadataValues>
<name>BuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>CanvasMode</name>
<value>
<stringValue>AUTO_LAYOUT_CANVAS</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>OriginBuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processType>AutoLaunchedFlow</processType>
<recordDeletes>
<name>Delete_all_Tasks_related_to_Contacts</name>
<label>Delete all Tasks related to Contacts</label>
<locationX>50</locationX>
<locationY>947</locationY>
<inputReference>Get_all_Tasks_related_to_Contacts</inputReference>
</recordDeletes>
<recordLookups>
<name>Get_all_contact_related_to_account</name>
<label>Get all contact related to account</label>
<locationX>182</locationX>
<locationY>323</locationY>
<assignNullValuesIfNoRecordsFound>false</assignNullValuesIfNoRecordsFound>
<connector>
<targetReference>Loop_through_the_contacts</targetReference>
</connector>
<filterLogic>and</filterLogic>
<filters>
<field>AccountId</field>
<operator>EqualTo</operator>
<value>
<elementReference>$Record.Id</elementReference>
</value>
</filters>
<getFirstRecordOnly>false</getFirstRecordOnly>
<object>Contact</object>
<storeOutputAutomatically>true</storeOutputAutomatically>
</recordLookups>
<recordLookups>
<name>Get_all_Tasks_related_to_Contacts</name>
<label>Get all Tasks related to Contacts</label>
<locationX>182</locationX>
<locationY>731</locationY>
<assignNullValuesIfNoRecordsFound>false</assignNullValuesIfNoRecordsFound>
<connector>
<targetReference>Any_records_to_delete_found</targetReference>
</connector>
<filterLogic>and</filterLogic>
<filters>
<field>WhoId</field>
<operator>In</operator>
<value>
<elementReference>ContactIds</elementReference>
</value>
</filters>
<getFirstRecordOnly>false</getFirstRecordOnly>
<object>Task</object>
<queriedFields>Id</queriedFields>
<storeOutputAutomatically>true</storeOutputAutomatically>
</recordLookups>
<start>
<locationX>56</locationX>
<locationY>0</locationY>
<connector>
<targetReference>Get_all_contact_related_to_account</targetReference>
</connector>
<doesRequireRecordChangedToMeetCriteria>true</doesRequireRecordChangedToMeetCriteria>
<filterLogic>and</filterLogic>
<filters>
<field>CleanStatus</field>
<operator>EqualTo</operator>
<value>
<stringValue>Inactive</stringValue>
</value>
</filters>
<object>Account</object>
<recordTriggerType>Update</recordTriggerType>
<triggerType>RecordAfterSave</triggerType>
</start>
<status>Active</status>
<variables>
<name>ContactIds</name>
<dataType>String</dataType>
<isCollection>true</isCollection>
<isInput>false</isInput>
<isOutput>false</isOutput>
</variables>
</Flow>
<?xml version="1.0" encoding="UTF-8"?>
<Flow xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>63.0</apiVersion>
<decisions>
<name>Any_records_to_delete_found</name>
<label>Any records to delete found?</label>
<locationX>182</locationX>
<locationY>647</locationY>
<defaultConnectorLabel>Default Outcome</defaultConnectorLabel>
<rules>
<name>Yes</name>
<conditionLogic>and</conditionLogic>
<conditions>
<leftValueReference>Get_all_Tasks_related_to_Contacts</leftValueReference>
<operator>IsNull</operator>
<rightValue>
<booleanValue>false</booleanValue>
</rightValue>
</conditions>
<connector>
<targetReference>Delete_all_Tasks_related_to_Contacts</targetReference>
</connector>
<label>Yes</label>
</rules>
</decisions>
<environments>Default</environments>
<interviewLabel>Antipattern 2 - Fix - No Loop {!$Flow.CurrentDateTime}</interviewLabel>
<label>Antipattern 2 - Fix - No Loop</label>
<processMetadataValues>
<name>BuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>CanvasMode</name>
<value>
<stringValue>AUTO_LAYOUT_CANVAS</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>OriginBuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processType>AutoLaunchedFlow</processType>
<recordDeletes>
<name>Delete_all_Tasks_related_to_Contacts</name>
<label>Delete all Tasks related to Contacts</label>
<locationX>50</locationX>
<locationY>755</locationY>
<inputReference>Get_all_Tasks_related_to_Contacts</inputReference>
</recordDeletes>
<recordLookups>
<name>Get_all_contact_related_to_account</name>
<label>Get all Contact related to Account</label>
<locationX>182</locationX>
<locationY>323</locationY>
<assignNullValuesIfNoRecordsFound>false</assignNullValuesIfNoRecordsFound>
<connector>
<targetReference>Get_All_Contact_Ids</targetReference>
</connector>
<filterLogic>and</filterLogic>
<filters>
<field>AccountId</field>
<operator>EqualTo</operator>
<value>
<elementReference>$Record.Id</elementReference>
</value>
</filters>
<getFirstRecordOnly>false</getFirstRecordOnly>
<object>Contact</object>
<storeOutputAutomatically>true</storeOutputAutomatically>
</recordLookups>
<recordLookups>
<name>Get_all_Tasks_related_to_Contacts</name>
<label>Get all Tasks related to Contacts</label>
<locationX>182</locationX>
<locationY>539</locationY>
<assignNullValuesIfNoRecordsFound>false</assignNullValuesIfNoRecordsFound>
<connector>
<targetReference>Any_records_to_delete_found</targetReference>
</connector>
<filterLogic>and</filterLogic>
<filters>
<field>WhoId</field>
<operator>In</operator>
<value>
<elementReference>Get_All_Contact_Ids</elementReference>
</value>
</filters>
<getFirstRecordOnly>false</getFirstRecordOnly>
<object>Task</object>
<queriedFields>Id</queriedFields>
<storeOutputAutomatically>true</storeOutputAutomatically>
</recordLookups>
<start>
<locationX>56</locationX>
<locationY>0</locationY>
<connector>
<targetReference>Get_all_contact_related_to_account</targetReference>
</connector>
<doesRequireRecordChangedToMeetCriteria>true</doesRequireRecordChangedToMeetCriteria>
<filterLogic>and</filterLogic>
<filters>
<field>CleanStatus</field>
<operator>EqualTo</operator>
<value>
<stringValue>Inactive</stringValue>
</value>
</filters>
<object>Account</object>
<recordTriggerType>Update</recordTriggerType>
<triggerType>RecordAfterSave</triggerType>
</start>
<status>Active</status>
<transforms>
<name>Get_All_Contact_Ids</name>
<label>Get All Contact Ids</label>
<locationX>182</locationX>
<locationY>431</locationY>
<connector>
<targetReference>Get_all_Tasks_related_to_Contacts</targetReference>
</connector>
<dataType>String</dataType>
<isCollection>true</isCollection>
<scale>0</scale>
<transformValues>
<transformValueActions>
<transformType>Map</transformType>
<value>
<elementReference>Get_all_contact_related_to_account[$EachItem].Id</elementReference>
</value>
</transformValueActions>
</transformValues>
</transforms>
</Flow>
<?xml version="1.0" encoding="UTF-8"?>
<Flow xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>63.0</apiVersion>
<assignments>
<name>Assign_Updated_Account_to_a_collection_A</name>
<label>Assign Updated Account to a collection</label>
<locationX>50</locationX>
<locationY>539</locationY>
<assignmentItems>
<assignToReference>ParentAccount.Id</assignToReference>
<operator>Assign</operator>
<value>
<elementReference>$Record.AccountId</elementReference>
</value>
</assignmentItems>
<assignmentItems>
<assignToReference>ParentAccount.Type</assignToReference>
<operator>Assign</operator>
<value>
<stringValue>Prospect</stringValue>
</value>
</assignmentItems>
<assignmentItems>
<assignToReference>ParentAccount.Description</assignToReference>
<operator>Assign</operator>
<value>
<elementReference>Description</elementReference>
</value>
</assignmentItems>
<assignmentItems>
<assignToReference>AccountsToUpdate</assignToReference>
<operator>Add</operator>
<value>
<elementReference>ParentAccount</elementReference>
</value>
</assignmentItems>
<connector>
<targetReference>Update_Parent_Accounts</targetReference>
</connector>
</assignments>
<assignments>
<name>Assign_Updated_Account_to_a_collection_B</name>
<label>Assign Updated Account to a collection</label>
<locationX>314</locationX>
<locationY>539</locationY>
<assignmentItems>
<assignToReference>ParentAccount.Id</assignToReference>
<operator>Assign</operator>
<value>
<elementReference>$Record.Account.Id</elementReference>
</value>
</assignmentItems>
<assignmentItems>
<assignToReference>ParentAccount.Type</assignToReference>
<operator>Assign</operator>
<value>
<stringValue>Customer - Direct</stringValue>
</value>
</assignmentItems>
<assignmentItems>
<assignToReference>ParentAccount.Description</assignToReference>
<operator>Assign</operator>
<value>
<elementReference>Description</elementReference>
</value>
</assignmentItems>
<assignmentItems>
<assignToReference>AccountsToUpdate</assignToReference>
<operator>Add</operator>
<value>
<elementReference>ParentAccount</elementReference>
</value>
</assignmentItems>
<connector>
<targetReference>Update_Parent_Accounts</targetReference>
</connector>
</assignments>
<assignments>
<name>Assign_Updated_Account_to_a_collection_C</name>
<label>Assign Updated Account to a collection</label>
<locationX>578</locationX>
<locationY>539</locationY>
<assignmentItems>
<assignToReference>ParentAccount.Id</assignToReference>
<operator>Assign</operator>
<value>
<elementReference>$Record.AccountId</elementReference>
</value>
</assignmentItems>
<assignmentItems>
<assignToReference>ParentAccount.Type</assignToReference>
<operator>Assign</operator>
<value>
<stringValue>Customer - Channel</stringValue>
</value>
</assignmentItems>
<assignmentItems>
<assignToReference>ParentAccount.Description</assignToReference>
<operator>Assign</operator>
<value>
<elementReference>Description</elementReference>
</value>
</assignmentItems>
<assignmentItems>
<assignToReference>AccountsToUpdate</assignToReference>
<operator>Add</operator>
<value>
<elementReference>ParentAccount</elementReference>
</value>
</assignmentItems>
<connector>
<targetReference>Update_Parent_Accounts</targetReference>
</connector>
</assignments>
<assignments>
<name>Assign_Updated_Account_to_a_collection_D</name>
<label>Assign Updated Account to a collection</label>
<locationX>842</locationX>
<locationY>539</locationY>
<assignmentItems>
<assignToReference>ParentAccount.Id</assignToReference>
<operator>Assign</operator>
<value>
<elementReference>$Record.AccountId</elementReference>
</value>
</assignmentItems>
<assignmentItems>
<assignToReference>ParentAccount.Type</assignToReference>
<operator>Assign</operator>
<value>
<stringValue>Channel Partner / Reseller</stringValue>
</value>
</assignmentItems>
<assignmentItems>
<assignToReference>ParentAccount.Description</assignToReference>
<operator>Assign</operator>
<value>
<elementReference>Description</elementReference>
</value>
</assignmentItems>
<assignmentItems>
<assignToReference>AccountsToUpdate</assignToReference>
<operator>Add</operator>
<value>
<elementReference>ParentAccount</elementReference>
</value>
</assignmentItems>
<connector>
<targetReference>Update_Parent_Accounts</targetReference>
</connector>
</assignments>
<assignments>
<name>Super_Important_Logic_For_A</name>
<label>Super Important Logic For A</label>
<locationX>50</locationX>
<locationY>431</locationY>
<assignmentItems>
<assignToReference>Description</assignToReference>
<operator>Assign</operator>
<value>
<stringValue>&quot;A&quot;</stringValue>
</value>
</assignmentItems>
<connector>
<targetReference>Assign_Updated_Account_to_a_collection_A</targetReference>
</connector>
</assignments>
<assignments>
<name>Super_Important_Logic_For_B</name>
<label>Super Important Logic For B</label>
<locationX>314</locationX>
<locationY>431</locationY>
<assignmentItems>
<assignToReference>Description</assignToReference>
<operator>Assign</operator>
<value>
<stringValue>&quot;b&quot;</stringValue>
</value>
</assignmentItems>
<connector>
<targetReference>Assign_Updated_Account_to_a_collection_B</targetReference>
</connector>
</assignments>
<assignments>
<name>Super_Important_Logic_For_C</name>
<label>Super Important Logic For C</label>
<locationX>578</locationX>
<locationY>431</locationY>
<assignmentItems>
<assignToReference>Description</assignToReference>
<operator>Assign</operator>
<value>
<stringValue>&quot;C&quot;</stringValue>
</value>
</assignmentItems>
<connector>
<targetReference>Assign_Updated_Account_to_a_collection_C</targetReference>
</connector>
</assignments>
<assignments>
<name>Super_Important_Logic_For_D</name>
<label>Super Important Logic For D</label>
<locationX>842</locationX>
<locationY>431</locationY>
<assignmentItems>
<assignToReference>Description</assignToReference>
<operator>Assign</operator>
<value>
<stringValue>&quot;A&quot;</stringValue>
</value>
</assignmentItems>
<connector>
<targetReference>Assign_Updated_Account_to_a_collection_D</targetReference>
</connector>
</assignments>
<decisions>
<name>What_is_the_Record_Type</name>
<label>What is the Record Type</label>
<locationX>446</locationX>
<locationY>323</locationY>
<defaultConnector>
<targetReference>Super_Important_Logic_For_D</targetReference>
</defaultConnector>
<defaultConnectorLabel>Record Type D</defaultConnectorLabel>
<rules>
<name>Record_Type_A</name>
<conditionLogic>and</conditionLogic>
<conditions>
<leftValueReference>$Record.Type</leftValueReference>
<operator>EqualTo</operator>
<rightValue>
<stringValue>Existing Customer - Upgrade</stringValue>
</rightValue>
</conditions>
<connector>
<targetReference>Super_Important_Logic_For_A</targetReference>
</connector>
<label>Record Type A</label>
</rules>
<rules>
<name>Record_Type_B</name>
<conditionLogic>and</conditionLogic>
<conditions>
<leftValueReference>$Record.Type</leftValueReference>
<operator>EqualTo</operator>
<rightValue>
<stringValue>Existing Customer - Replacement</stringValue>
</rightValue>
</conditions>
<connector>
<targetReference>Super_Important_Logic_For_B</targetReference>
</connector>
<label>Record Type B</label>
</rules>
<rules>
<name>Record_Type_C</name>
<conditionLogic>and</conditionLogic>
<conditions>
<leftValueReference>$Record.Type</leftValueReference>
<operator>EqualTo</operator>
<rightValue>
<stringValue>Existing Customer - Downgrade</stringValue>
</rightValue>
</conditions>
<connector>
<targetReference>Super_Important_Logic_For_C</targetReference>
</connector>
<label>Record Type C</label>
</rules>
</decisions>
<environments>Default</environments>
<interviewLabel>Antipattern 3 {!$Flow.CurrentDateTime}</interviewLabel>
<label>Antipattern 3</label>
<processMetadataValues>
<name>BuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>CanvasMode</name>
<value>
<stringValue>AUTO_LAYOUT_CANVAS</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>OriginBuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processType>AutoLaunchedFlow</processType>
<recordUpdates>
<name>Update_Parent_Accounts</name>
<label>Update Parent Accounts</label>
<locationX>446</locationX>
<locationY>731</locationY>
<inputReference>AccountsToUpdate</inputReference>
</recordUpdates>
<start>
<locationX>320</locationX>
<locationY>0</locationY>
<connector>
<targetReference>What_is_the_Record_Type</targetReference>
</connector>
<object>Opportunity</object>
<recordTriggerType>Create</recordTriggerType>
<triggerType>RecordAfterSave</triggerType>
</start>
<status>Active</status>
<variables>
<name>AccountsToUpdate</name>
<dataType>SObject</dataType>
<isCollection>true</isCollection>
<isInput>false</isInput>
<isOutput>false</isOutput>
<objectType>Account</objectType>
</variables>
<variables>
<name>Description</name>
<dataType>String</dataType>
<isCollection>false</isCollection>
<isInput>false</isInput>
<isOutput>false</isOutput>
</variables>
<variables>
<name>ParentAccount</name>
<dataType>SObject</dataType>
<isCollection>false</isCollection>
<isInput>false</isInput>
<isOutput>false</isOutput>
<objectType>Account</objectType>
</variables>
</Flow>
<?xml version="1.0" encoding="UTF-8"?>
<Flow xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>63.0</apiVersion>
<decisions>
<name>What_is_the_Record_Type</name>
<label>What is the Record Type</label>
<locationX>446</locationX>
<locationY>323</locationY>
<defaultConnector>
<targetReference>Subflow_For_Record_Type_D</targetReference>
</defaultConnector>
<defaultConnectorLabel>Record Type D</defaultConnectorLabel>
<rules>
<name>Record_Type_A</name>
<conditionLogic>and</conditionLogic>
<conditions>
<leftValueReference>$Record.Type</leftValueReference>
<operator>EqualTo</operator>
<rightValue>
<stringValue>Existing Customer - Upgrade</stringValue>
</rightValue>
</conditions>
<connector>
<targetReference>Subflow_For_Record_Type_A</targetReference>
</connector>
<label>Record Type A</label>
</rules>
<rules>
<name>Record_Type_B</name>
<conditionLogic>and</conditionLogic>
<conditions>
<leftValueReference>$Record.Type</leftValueReference>
<operator>EqualTo</operator>
<rightValue>
<stringValue>Existing Customer - Replacement</stringValue>
</rightValue>
</conditions>
<connector>
<targetReference>Subflow_For_Record_Type_B</targetReference>
</connector>
<label>Record Type B</label>
</rules>
<rules>
<name>Record_Type_C</name>
<conditionLogic>and</conditionLogic>
<conditions>
<leftValueReference>$Record.Type</leftValueReference>
<operator>EqualTo</operator>
<rightValue>
<stringValue>Existing Customer - Downgrade</stringValue>
</rightValue>
</conditions>
<connector>
<targetReference>Subflow_For_Record_Type_C</targetReference>
</connector>
<label>Record Type C</label>
</rules>
</decisions>
<environments>Default</environments>
<interviewLabel>Antipattern 4 {!$Flow.CurrentDateTime}</interviewLabel>
<label>Antipattern 4</label>
<processMetadataValues>
<name>BuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>CanvasMode</name>
<value>
<stringValue>AUTO_LAYOUT_CANVAS</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>OriginBuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processType>AutoLaunchedFlow</processType>
<start>
<locationX>320</locationX>
<locationY>0</locationY>
<connector>
<targetReference>What_is_the_Record_Type</targetReference>
</connector>
<object>Opportunity</object>
<recordTriggerType>Create</recordTriggerType>
<triggerType>RecordAfterSave</triggerType>
</start>
<status>Active</status>
<subflows>
<name>Subflow_For_Record_Type_A</name>
<label>Subflow For Record Type A</label>
<locationX>50</locationX>
<locationY>431</locationY>
<flowName>Antipattern_4_Subflow_A</flowName>
<inputAssignments>
<name>OpportunityRecord</name>
<value>
<elementReference>$Record</elementReference>
</value>
</inputAssignments>
</subflows>
<subflows>
<name>Subflow_For_Record_Type_B</name>
<label>Subflow For Record Type B</label>
<locationX>314</locationX>
<locationY>431</locationY>
<flowName>Antipattern_4_Subflow_B</flowName>
<inputAssignments>
<name>OpportunityRecord</name>
<value>
<elementReference>$Record</elementReference>
</value>
</inputAssignments>
</subflows>
<subflows>
<name>Subflow_For_Record_Type_C</name>
<label>Subflow For Record Type C</label>
<locationX>578</locationX>
<locationY>431</locationY>
<flowName>Antipattern_4_Subflow_C</flowName>
<inputAssignments>
<name>OpportunityRecord</name>
<value>
<elementReference>$Record</elementReference>
</value>
</inputAssignments>
</subflows>
<subflows>
<name>Subflow_For_Record_Type_D</name>
<label>Subflow For Record Type D</label>
<locationX>842</locationX>
<locationY>431</locationY>
<flowName>Antipattern_4_Subflow_D</flowName>
<inputAssignments>
<name>OpportunityRecord</name>
<value>
<elementReference>$Record</elementReference>
</value>
</inputAssignments>
</subflows>
<variables>
<name>AccountsToUpdate</name>
<dataType>SObject</dataType>
<isCollection>true</isCollection>
<isInput>false</isInput>
<isOutput>false</isOutput>
<objectType>Account</objectType>
</variables>
<variables>
<name>Description</name>
<dataType>String</dataType>
<isCollection>false</isCollection>
<isInput>false</isInput>
<isOutput>false</isOutput>
</variables>
<variables>
<name>ParentAccount</name>
<dataType>SObject</dataType>
<isCollection>false</isCollection>
<isInput>false</isInput>
<isOutput>false</isOutput>
<objectType>Account</objectType>
</variables>
</Flow>
<?xml version="1.0" encoding="UTF-8"?>
<Flow xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>63.0</apiVersion>
<decisions>
<name>What_is_the_Record_Type</name>
<label>What is the Record Type</label>
<locationX>446</locationX>
<locationY>323</locationY>
<defaultConnector>
<targetReference>Antipattern_4_Subflow_D_Fixed_Flow_1</targetReference>
</defaultConnector>
<defaultConnectorLabel>Record Type D</defaultConnectorLabel>
<rules>
<name>Record_Type_A</name>
<conditionLogic>and</conditionLogic>
<conditions>
<leftValueReference>$Record.Type</leftValueReference>
<operator>EqualTo</operator>
<rightValue>
<stringValue>Existing Customer - Upgrade</stringValue>
</rightValue>
</conditions>
<connector>
<targetReference>Subflow_For_Record_Type_A_Fixed</targetReference>
</connector>
<label>Record Type A</label>
</rules>
<rules>
<name>Record_Type_B</name>
<conditionLogic>and</conditionLogic>
<conditions>
<leftValueReference>$Record.Type</leftValueReference>
<operator>EqualTo</operator>
<rightValue>
<stringValue>Existing Customer - Replacement</stringValue>
</rightValue>
</conditions>
<connector>
<targetReference>Subflow_For_Record_Type_B_Fixed</targetReference>
</connector>
<label>Record Type B</label>
</rules>
<rules>
<name>Record_Type_C</name>
<conditionLogic>and</conditionLogic>
<conditions>
<leftValueReference>$Record.Type</leftValueReference>
<operator>EqualTo</operator>
<rightValue>
<stringValue>Existing Customer - Downgrade</stringValue>
</rightValue>
</conditions>
<connector>
<targetReference>Subflow_For_Record_Type_C_Fixed</targetReference>
</connector>
<label>Record Type C</label>
</rules>
</decisions>
<environments>Default</environments>
<interviewLabel>Antipattern 4 Fix {!$Flow.CurrentDateTime}</interviewLabel>
<label>Antipattern 4 Fix</label>
<processMetadataValues>
<name>BuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>CanvasMode</name>
<value>
<stringValue>AUTO_LAYOUT_CANVAS</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>OriginBuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processType>AutoLaunchedFlow</processType>
<recordUpdates>
<name>Update_Records_1</name>
<label>Update Records 1</label>
<locationX>446</locationX>
<locationY>623</locationY>
<inputReference>ParentAccount</inputReference>
</recordUpdates>
<start>
<locationX>320</locationX>
<locationY>0</locationY>
<connector>
<targetReference>What_is_the_Record_Type</targetReference>
</connector>
<object>Opportunity</object>
<recordTriggerType>Create</recordTriggerType>
<triggerType>RecordAfterSave</triggerType>
</start>
<status>Active</status>
<subflows>
<name>Antipattern_4_Subflow_D_Fixed_Flow_1</name>
<label>Subflow For Record Type C Fixed</label>
<locationX>842</locationX>
<locationY>431</locationY>
<connector>
<targetReference>Update_Records_1</targetReference>
</connector>
<flowName>Antipattern_4_Subflow_D_Fix</flowName>
<inputAssignments>
<name>OpportunityRecord</name>
<value>
<elementReference>$Record</elementReference>
</value>
</inputAssignments>
<outputAssignments>
<assignToReference>ParentAccount</assignToReference>
<name>ParentAccount</name>
</outputAssignments>
</subflows>
<subflows>
<name>Subflow_For_Record_Type_A_Fixed</name>
<label>Subflow For Record Type A Fixed</label>
<locationX>50</locationX>
<locationY>431</locationY>
<connector>
<targetReference>Update_Records_1</targetReference>
</connector>
<flowName>Antipattern_4_Subflow_A_Fix</flowName>
<inputAssignments>
<name>OpportunityRecord</name>
<value>
<elementReference>$Record</elementReference>
</value>
</inputAssignments>
<outputAssignments>
<assignToReference>ParentAccount</assignToReference>
<name>ParentAccount</name>
</outputAssignments>
</subflows>
<subflows>
<name>Subflow_For_Record_Type_B_Fixed</name>
<label>Subflow For Record Type B Fixed</label>
<locationX>314</locationX>
<locationY>431</locationY>
<connector>
<targetReference>Update_Records_1</targetReference>
</connector>
<flowName>Antipattern_4_Subflow_B_Fix</flowName>
<inputAssignments>
<name>OpportunityRecord</name>
<value>
<elementReference>$Record</elementReference>
</value>
</inputAssignments>
<outputAssignments>
<assignToReference>ParentAccount</assignToReference>
<name>ParentAccount</name>
</outputAssignments>
</subflows>
<subflows>
<name>Subflow_For_Record_Type_C_Fixed</name>
<label>Subflow For Record Type C Fixed</label>
<locationX>578</locationX>
<locationY>431</locationY>
<connector>
<targetReference>Update_Records_1</targetReference>
</connector>
<flowName>Antipattern_4_Subflow_C_Fix</flowName>
<inputAssignments>
<name>OpportunityRecord</name>
<value>
<elementReference>$Record</elementReference>
</value>
</inputAssignments>
<outputAssignments>
<assignToReference>ParentAccount</assignToReference>
<name>ParentAccount</name>
</outputAssignments>
</subflows>
<variables>
<name>AccountsToUpdate</name>
<dataType>SObject</dataType>
<isCollection>true</isCollection>
<isInput>false</isInput>
<isOutput>false</isOutput>
<objectType>Account</objectType>
</variables>
<variables>
<name>Description</name>
<dataType>String</dataType>
<isCollection>false</isCollection>
<isInput>false</isInput>
<isOutput>false</isOutput>
</variables>
<variables>
<name>OpportunitiesToUpdate</name>
<dataType>SObject</dataType>
<isCollection>true</isCollection>
<isInput>false</isInput>
<isOutput>false</isOutput>
<objectType>Opportunity</objectType>
</variables>
<variables>
<name>ParentAccount</name>
<dataType>SObject</dataType>
<isCollection>false</isCollection>
<isInput>false</isInput>
<isOutput>false</isOutput>
<objectType>Account</objectType>
</variables>
</Flow>
<?xml version="1.0" encoding="UTF-8"?>
<Flow xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>63.0</apiVersion>
<assignments>
<name>Super_Important_Logic_For_A</name>
<label>Super Important Logic For A</label>
<locationX>176</locationX>
<locationY>134</locationY>
<assignmentItems>
<assignToReference>Description</assignToReference>
<operator>Assign</operator>
<value>
<stringValue>&quot;A&quot;</stringValue>
</value>
</assignmentItems>
<assignmentItems>
<assignToReference>ParentAccount.Id</assignToReference>
<operator>Assign</operator>
<value>
<elementReference>OpportunityRecord.Account.Id</elementReference>
</value>
</assignmentItems>
<assignmentItems>
<assignToReference>ParentAccount.Type</assignToReference>
<operator>Assign</operator>
<value>
<stringValue>Prospect</stringValue>
</value>
</assignmentItems>
<connector>
<targetReference>Update_Parent_Account</targetReference>
</connector>
</assignments>
<environments>Default</environments>
<interviewLabel>Antipattern 4 - Subflow A {!$Flow.CurrentDateTime}</interviewLabel>
<label>Antipattern 4 - Subflow A</label>
<processMetadataValues>
<name>BuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>CanvasMode</name>
<value>
<stringValue>AUTO_LAYOUT_CANVAS</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>OriginBuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processType>AutoLaunchedFlow</processType>
<recordUpdates>
<name>Update_Parent_Account</name>
<label>Update Parent Account</label>
<locationX>176</locationX>
<locationY>242</locationY>
<inputReference>ParentAccount</inputReference>
</recordUpdates>
<start>
<locationX>50</locationX>
<locationY>0</locationY>
<connector>
<targetReference>Super_Important_Logic_For_A</targetReference>
</connector>
</start>
<status>Draft</status>
<variables>
<name>Description</name>
<dataType>String</dataType>
<isCollection>false</isCollection>
<isInput>false</isInput>
<isOutput>false</isOutput>
</variables>
<variables>
<description>Input variable for Opportunity being processed by this subflow</description>
<name>OpportunityRecord</name>
<dataType>SObject</dataType>
<isCollection>false</isCollection>
<isInput>true</isInput>
<isOutput>false</isOutput>
<objectType>Opportunity</objectType>
</variables>
<variables>
<name>ParentAccount</name>
<dataType>SObject</dataType>
<isCollection>false</isCollection>
<isInput>false</isInput>
<isOutput>false</isOutput>
<objectType>Account</objectType>
</variables>
</Flow>
<?xml version="1.0" encoding="UTF-8"?>
<Flow xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>63.0</apiVersion>
<assignments>
<name>Super_Important_Logic_For_A</name>
<label>Super Important Logic For A</label>
<locationX>176</locationX>
<locationY>134</locationY>
<assignmentItems>
<assignToReference>Description</assignToReference>
<operator>Assign</operator>
<value>
<stringValue>&quot;A&quot;</stringValue>
</value>
</assignmentItems>
<assignmentItems>
<assignToReference>ParentAccount.Id</assignToReference>
<operator>Assign</operator>
<value>
<elementReference>OpportunityRecord.Account.Id</elementReference>
</value>
</assignmentItems>
<assignmentItems>
<assignToReference>ParentAccount.Type</assignToReference>
<operator>Assign</operator>
<value>
<stringValue>Prospect</stringValue>
</value>
</assignmentItems>
<assignmentItems>
<assignToReference>ParentAccount.Description</assignToReference>
<operator>Assign</operator>
<value>
<elementReference>Description</elementReference>
</value>
</assignmentItems>
</assignments>
<environments>Default</environments>
<interviewLabel>Antipattern 4 - Subflow A Fix {!$Flow.CurrentDateTime}</interviewLabel>
<label>Antipattern 4 - Subflow A Fixed</label>
<processMetadataValues>
<name>BuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>CanvasMode</name>
<value>
<stringValue>AUTO_LAYOUT_CANVAS</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>OriginBuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processType>AutoLaunchedFlow</processType>
<start>
<locationX>50</locationX>
<locationY>0</locationY>
<connector>
<targetReference>Super_Important_Logic_For_A</targetReference>
</connector>
</start>
<status>Active</status>
<variables>
<name>Description</name>
<dataType>String</dataType>
<isCollection>false</isCollection>
<isInput>false</isInput>
<isOutput>false</isOutput>
</variables>
<variables>
<description>Input variable for Opportunity being processed by this subflow</description>
<name>OpportunityRecord</name>
<dataType>SObject</dataType>
<isCollection>false</isCollection>
<isInput>true</isInput>
<isOutput>false</isOutput>
<objectType>Opportunity</objectType>
</variables>
<variables>
<name>ParentAccount</name>
<dataType>SObject</dataType>
<isCollection>false</isCollection>
<isInput>false</isInput>
<isOutput>true</isOutput>
<objectType>Account</objectType>
</variables>
</Flow>
<?xml version="1.0" encoding="UTF-8"?>
<Flow xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>63.0</apiVersion>
<assignments>
<name>Super_Important_Logic_For_B</name>
<label>Super Important Logic For B</label>
<locationX>176</locationX>
<locationY>134</locationY>
<assignmentItems>
<assignToReference>Description</assignToReference>
<operator>Assign</operator>
<value>
<stringValue>&quot;B&quot;</stringValue>
</value>
</assignmentItems>
<assignmentItems>
<assignToReference>ParentAccount.Id</assignToReference>
<operator>Assign</operator>
<value>
<elementReference>OpportunityRecord.Account.Id</elementReference>
</value>
</assignmentItems>
<assignmentItems>
<assignToReference>ParentAccount.Type</assignToReference>
<operator>Assign</operator>
<value>
<stringValue>Prospect</stringValue>
</value>
</assignmentItems>
<connector>
<targetReference>Update_Parent_Account</targetReference>
</connector>
</assignments>
<environments>Default</environments>
<interviewLabel>Antipattern 4 - Subflow B {!$Flow.CurrentDateTime}</interviewLabel>
<label>Antipattern 4 - Subflow B</label>
<processMetadataValues>
<name>BuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>CanvasMode</name>
<value>
<stringValue>AUTO_LAYOUT_CANVAS</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>OriginBuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processType>AutoLaunchedFlow</processType>
<recordUpdates>
<name>Update_Parent_Account</name>
<label>Update Parent Account</label>
<locationX>176</locationX>
<locationY>242</locationY>
<inputReference>ParentAccount</inputReference>
</recordUpdates>
<start>
<locationX>50</locationX>
<locationY>0</locationY>
<connector>
<targetReference>Super_Important_Logic_For_B</targetReference>
</connector>
</start>
<status>Active</status>
<variables>
<name>Description</name>
<dataType>String</dataType>
<isCollection>false</isCollection>
<isInput>false</isInput>
<isOutput>false</isOutput>
</variables>
<variables>
<description>Input variable for Opportunity being processed by this subflow</description>
<name>OpportunityRecord</name>
<dataType>SObject</dataType>
<isCollection>false</isCollection>
<isInput>true</isInput>
<isOutput>false</isOutput>
<objectType>Opportunity</objectType>
</variables>
<variables>
<name>ParentAccount</name>
<dataType>SObject</dataType>
<isCollection>false</isCollection>
<isInput>false</isInput>
<isOutput>false</isOutput>
<objectType>Account</objectType>
</variables>
</Flow>
<?xml version="1.0" encoding="UTF-8"?>
<Flow xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>63.0</apiVersion>
<assignments>
<name>Super_Important_Logic_For_B</name>
<label>Super Important Logic For B</label>
<locationX>176</locationX>
<locationY>134</locationY>
<assignmentItems>
<assignToReference>Description</assignToReference>
<operator>Assign</operator>
<value>
<stringValue>&quot;B&quot;</stringValue>
</value>
</assignmentItems>
<assignmentItems>
<assignToReference>ParentAccount.Id</assignToReference>
<operator>Assign</operator>
<value>
<elementReference>OpportunityRecord.Account.Id</elementReference>
</value>
</assignmentItems>
<assignmentItems>
<assignToReference>ParentAccount.Type</assignToReference>
<operator>Assign</operator>
<value>
<stringValue>Customer - Direct</stringValue>
</value>
</assignmentItems>
<assignmentItems>
<assignToReference>ParentAccount.Description</assignToReference>
<operator>Assign</operator>
<value>
<elementReference>Description</elementReference>
</value>
</assignmentItems>
</assignments>
<environments>Default</environments>
<interviewLabel>Antipattern 4 - Subflow B Fix {!$Flow.CurrentDateTime}</interviewLabel>
<label>Antipattern 4 - Subflow B Fixed</label>
<processMetadataValues>
<name>BuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>CanvasMode</name>
<value>
<stringValue>AUTO_LAYOUT_CANVAS</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>OriginBuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processType>AutoLaunchedFlow</processType>
<start>
<locationX>50</locationX>
<locationY>0</locationY>
<connector>
<targetReference>Super_Important_Logic_For_B</targetReference>
</connector>
</start>
<status>Active</status>
<variables>
<name>Description</name>
<dataType>String</dataType>
<isCollection>false</isCollection>
<isInput>false</isInput>
<isOutput>false</isOutput>
</variables>
<variables>
<description>Input variable for Opportunity being processed by this subflow</description>
<name>OpportunityRecord</name>
<dataType>SObject</dataType>
<isCollection>false</isCollection>
<isInput>true</isInput>
<isOutput>false</isOutput>
<objectType>Opportunity</objectType>
</variables>
<variables>
<name>ParentAccount</name>
<dataType>SObject</dataType>
<isCollection>false</isCollection>
<isInput>false</isInput>
<isOutput>true</isOutput>
<objectType>Account</objectType>
</variables>
</Flow>
<?xml version="1.0" encoding="UTF-8"?>
<Flow xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>63.0</apiVersion>
<assignments>
<name>Super_Important_Logic_For_C</name>
<label>Super Important Logic For C</label>
<locationX>176</locationX>
<locationY>134</locationY>
<assignmentItems>
<assignToReference>Description</assignToReference>
<operator>Assign</operator>
<value>
<stringValue>&quot;C&quot;</stringValue>
</value>
</assignmentItems>
<assignmentItems>
<assignToReference>ParentAccount.Id</assignToReference>
<operator>Assign</operator>
<value>
<elementReference>OpportunityRecord.Account.Id</elementReference>
</value>
</assignmentItems>
<assignmentItems>
<assignToReference>ParentAccount.Type</assignToReference>
<operator>Assign</operator>
<value>
<stringValue>Prospect</stringValue>
</value>
</assignmentItems>
<connector>
<targetReference>Update_Parent_Account</targetReference>
</connector>
</assignments>
<environments>Default</environments>
<interviewLabel>Antipattern 4 - Subflow c {!$Flow.CurrentDateTime}</interviewLabel>
<label>Antipattern 4 - Subflow C</label>
<processMetadataValues>
<name>BuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>CanvasMode</name>
<value>
<stringValue>AUTO_LAYOUT_CANVAS</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>OriginBuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processType>AutoLaunchedFlow</processType>
<recordUpdates>
<name>Update_Parent_Account</name>
<label>Update Parent Account</label>
<locationX>176</locationX>
<locationY>242</locationY>
<inputReference>ParentAccount</inputReference>
</recordUpdates>
<start>
<locationX>50</locationX>
<locationY>0</locationY>
<connector>
<targetReference>Super_Important_Logic_For_C</targetReference>
</connector>
</start>
<status>Active</status>
<variables>
<name>Description</name>
<dataType>String</dataType>
<isCollection>false</isCollection>
<isInput>false</isInput>
<isOutput>false</isOutput>
</variables>
<variables>
<description>Input variable for Opportunity being processed by this subflow</description>
<name>OpportunityRecord</name>
<dataType>SObject</dataType>
<isCollection>false</isCollection>
<isInput>true</isInput>
<isOutput>false</isOutput>
<objectType>Opportunity</objectType>
</variables>
<variables>
<name>ParentAccount</name>
<dataType>SObject</dataType>
<isCollection>false</isCollection>
<isInput>false</isInput>
<isOutput>false</isOutput>
<objectType>Account</objectType>
</variables>
</Flow>
<?xml version="1.0" encoding="UTF-8"?>
<Flow xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>63.0</apiVersion>
<assignments>
<name>Super_Important_Logic_For_C</name>
<label>Super Important Logic For C</label>
<locationX>176</locationX>
<locationY>134</locationY>
<assignmentItems>
<assignToReference>Description</assignToReference>
<operator>Assign</operator>
<value>
<stringValue>&quot;C&quot;</stringValue>
</value>
</assignmentItems>
<assignmentItems>
<assignToReference>ParentAccount.Id</assignToReference>
<operator>Assign</operator>
<value>
<elementReference>OpportunityRecord.Account.Id</elementReference>
</value>
</assignmentItems>
<assignmentItems>
<assignToReference>ParentAccount.Type</assignToReference>
<operator>Assign</operator>
<value>
<stringValue>Customer - Channel</stringValue>
</value>
</assignmentItems>
<assignmentItems>
<assignToReference>ParentAccount.Description</assignToReference>
<operator>Assign</operator>
<value>
<elementReference>Description</elementReference>
</value>
</assignmentItems>
</assignments>
<environments>Default</environments>
<interviewLabel>Antipattern 4 - Subflow C Fix {!$Flow.CurrentDateTime}</interviewLabel>
<label>Antipattern 4 - Subflow C Fixed</label>
<processMetadataValues>
<name>BuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>CanvasMode</name>
<value>
<stringValue>AUTO_LAYOUT_CANVAS</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>OriginBuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processType>AutoLaunchedFlow</processType>
<start>
<locationX>50</locationX>
<locationY>0</locationY>
<connector>
<targetReference>Super_Important_Logic_For_C</targetReference>
</connector>
</start>
<status>Active</status>
<variables>
<name>Description</name>
<dataType>String</dataType>
<isCollection>false</isCollection>
<isInput>false</isInput>
<isOutput>false</isOutput>
</variables>
<variables>
<description>Input variable for Opportunity being processed by this subflow</description>
<name>OpportunityRecord</name>
<dataType>SObject</dataType>
<isCollection>false</isCollection>
<isInput>true</isInput>
<isOutput>false</isOutput>
<objectType>Opportunity</objectType>
</variables>
<variables>
<name>ParentAccount</name>
<dataType>SObject</dataType>
<isCollection>false</isCollection>
<isInput>false</isInput>
<isOutput>true</isOutput>
<objectType>Account</objectType>
</variables>
</Flow>
<?xml version="1.0" encoding="UTF-8"?>
<Flow xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>63.0</apiVersion>
<assignments>
<name>Super_Important_Logic_For_D</name>
<label>Super Important Logic For D</label>
<locationX>176</locationX>
<locationY>134</locationY>
<assignmentItems>
<assignToReference>Description</assignToReference>
<operator>Assign</operator>
<value>
<stringValue>&quot;D&quot;</stringValue>
</value>
</assignmentItems>
<assignmentItems>
<assignToReference>ParentAccount.Id</assignToReference>
<operator>Assign</operator>
<value>
<elementReference>OpportunityRecord.Account.Id</elementReference>
</value>
</assignmentItems>
<assignmentItems>
<assignToReference>ParentAccount.Type</assignToReference>
<operator>Assign</operator>
<value>
<stringValue>Prospect</stringValue>
</value>
</assignmentItems>
<connector>
<targetReference>Update_Parent_Account</targetReference>
</connector>
</assignments>
<environments>Default</environments>
<interviewLabel>Antipattern 4 - Subflow D {!$Flow.CurrentDateTime}</interviewLabel>
<label>Antipattern 4 - Subflow D</label>
<processMetadataValues>
<name>BuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>CanvasMode</name>
<value>
<stringValue>AUTO_LAYOUT_CANVAS</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>OriginBuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processType>AutoLaunchedFlow</processType>
<recordUpdates>
<name>Update_Parent_Account</name>
<label>Update Parent Account</label>
<locationX>176</locationX>
<locationY>242</locationY>
<inputReference>ParentAccount</inputReference>
</recordUpdates>
<start>
<locationX>50</locationX>
<locationY>0</locationY>
<connector>
<targetReference>Super_Important_Logic_For_D</targetReference>
</connector>
</start>
<status>Active</status>
<variables>
<name>Description</name>
<dataType>String</dataType>
<isCollection>false</isCollection>
<isInput>false</isInput>
<isOutput>false</isOutput>
</variables>
<variables>
<description>Input variable for Opportunity being processed by this subflow</description>
<name>OpportunityRecord</name>
<dataType>SObject</dataType>
<isCollection>false</isCollection>
<isInput>true</isInput>
<isOutput>false</isOutput>
<objectType>Opportunity</objectType>
</variables>
<variables>
<name>ParentAccount</name>
<dataType>SObject</dataType>
<isCollection>false</isCollection>
<isInput>false</isInput>
<isOutput>false</isOutput>
<objectType>Account</objectType>
</variables>
</Flow>
<?xml version="1.0" encoding="UTF-8"?>
<Flow xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>63.0</apiVersion>
<assignments>
<name>Super_Important_Logic_For_D</name>
<label>Super Important Logic For D</label>
<locationX>176</locationX>
<locationY>134</locationY>
<assignmentItems>
<assignToReference>Description</assignToReference>
<operator>Assign</operator>
<value>
<stringValue>&quot;D&quot;</stringValue>
</value>
</assignmentItems>
<assignmentItems>
<assignToReference>ParentAccount.Id</assignToReference>
<operator>Assign</operator>
<value>
<elementReference>OpportunityRecord.Account.Id</elementReference>
</value>
</assignmentItems>
<assignmentItems>
<assignToReference>ParentAccount.Type</assignToReference>
<operator>Assign</operator>
<value>
<stringValue>Channel Partner / Reseller</stringValue>
</value>
</assignmentItems>
<assignmentItems>
<assignToReference>ParentAccount.Description</assignToReference>
<operator>Assign</operator>
<value>
<elementReference>Description</elementReference>
</value>
</assignmentItems>
</assignments>
<environments>Default</environments>
<interviewLabel>Antipattern 4 - Subflow D Fix {!$Flow.CurrentDateTime}</interviewLabel>
<label>Antipattern 4 - Subflow D Fixed</label>
<processMetadataValues>
<name>BuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>CanvasMode</name>
<value>
<stringValue>AUTO_LAYOUT_CANVAS</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>OriginBuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processType>AutoLaunchedFlow</processType>
<start>
<locationX>50</locationX>
<locationY>0</locationY>
<connector>
<targetReference>Super_Important_Logic_For_D</targetReference>
</connector>
</start>
<status>Active</status>
<variables>
<name>Description</name>
<dataType>String</dataType>
<isCollection>false</isCollection>
<isInput>false</isInput>
<isOutput>false</isOutput>
</variables>
<variables>
<description>Input variable for Opportunity being processed by this subflow</description>
<name>OpportunityRecord</name>
<dataType>SObject</dataType>
<isCollection>false</isCollection>
<isInput>true</isInput>
<isOutput>false</isOutput>
<objectType>Opportunity</objectType>
</variables>
<variables>
<name>ParentAccount</name>
<dataType>SObject</dataType>
<isCollection>false</isCollection>
<isInput>false</isInput>
<isOutput>true</isOutput>
<objectType>Account</objectType>
</variables>
</Flow>
<?xml version="1.0" encoding="UTF-8"?>
<Flow xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>63.0</apiVersion>
<environments>Default</environments>
<interviewLabel>Antipattern 5 {!$Flow.CurrentDateTime}</interviewLabel>
<label>Antipattern 5</label>
<processMetadataValues>
<name>BuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>CanvasMode</name>
<value>
<stringValue>AUTO_LAYOUT_CANVAS</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>OriginBuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processType>AutoLaunchedFlow</processType>
<recordLookups>
<name>Get_Lead_Queue</name>
<label>Get Lead Queue</label>
<locationX>176</locationX>
<locationY>287</locationY>
<assignNullValuesIfNoRecordsFound>false</assignNullValuesIfNoRecordsFound>
<connector>
<targetReference>Update_Lead_Owner</targetReference>
</connector>
<filterLogic>and</filterLogic>
<filters>
<field>Type</field>
<operator>EqualTo</operator>
<value>
<stringValue>Queue</stringValue>
</value>
</filters>
<filters>
<field>DeveloperName</field>
<operator>EqualTo</operator>
<value>
<stringValue>Lead_Queue</stringValue>
</value>
</filters>
<getFirstRecordOnly>true</getFirstRecordOnly>
<object>Group</object>
<storeOutputAutomatically>true</storeOutputAutomatically>
</recordLookups>
<recordUpdates>
<name>Update_Lead_Owner</name>
<label>Update Lead Owner</label>
<locationX>176</locationX>
<locationY>395</locationY>
<inputAssignments>
<field>OwnerId</field>
<value>
<elementReference>Get_Lead_Queue.Id</elementReference>
</value>
</inputAssignments>
<inputReference>$Record</inputReference>
</recordUpdates>
<start>
<locationX>50</locationX>
<locationY>0</locationY>
<connector>
<targetReference>Get_Lead_Queue</targetReference>
</connector>
<object>Lead</object>
<recordTriggerType>Create</recordTriggerType>
<triggerType>RecordBeforeSave</triggerType>
</start>
<status>Draft</status>
</Flow>
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment