function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Andee Weir 17Andee Weir 17 

Lead conversion - how to recognise in process builder

Hi,

We currently have a mapping of lead fields to account e.g. Street Line 1 etc.  We also have a process builder flow that kicks off a batch process if an account's address changes.  The final piece of the puzzle is a scheduled batch job that automatically converts leads into contacts if certain criteria are met. 

The problem is that when this scheduled batch job runs, the lead to contact apex code attaches an existing account to the new contact which seems to cause the account to be updated (I think this is vanilla salesforce because of the lead to account field mapping) which in turn causes the process builder flow to start (& fail) as it cannot start a batch job from a batch job.

So is it possible to recognise in the flow if the account update is due to lead conversion or alternatively if the flow is already running in a batch?  If not, is there a way to force the lead field mapping to only happen if a new account is being created & ignore updates to existing accounts.  The process builder update needs to run as a batch as it updates all of the account's contacts which could be many. 

Thanks in advance for any help you can offer.