I have specific requirement where I have 2 different process builder - #1 , #2 on same object. The two process builder basically send out two different types of email alerts based on whether the record was created/edited by dataloader or updated using a visualforce page which has a button to invoke a batch job. When this batch job is invoked i want to run process builder #2 and when when I use dataloader I want #1 process builder to run.
My initial idea was to use a custom field which I can use in process builder criteria. By default the value of this field is false which makes process builder #1's condition to be met since I have set a condition as when field value ->is null = false run process builder #1.and process builder #2 condition has field value ->is null = true. So when I use the visualforce page which invokes a batch job I update the field as true and the process builder #2 runs, once I am finished I would like to make the field as false again so that when I load the data using dataloader process builder #1 could run.
Here my problem is when the batch job finishes and in finish() when I try to make the field back to false and do an update , process builder #1 runs since it satisfy the condition. I do not want #1 to run right away when I am updating just the field value back to false.
Is there any work around?