Invocable process
Invocable processes are the processes which are built to modularise the code and reuse it whenever required, for example when your organisation closes won an opportunity, then a follow up task created for the owner to touch base with the account contact. Similarly when an Opportunity is closed Lost, then a follow up task is created to touch base with the Account contact.
Therefore it makes sense that you build a process build which creates a follow up task and is then called from different nodes of another process and gets executed.
To Create a invocable process you need to follow the below process.
- Click on the Gear Icon on the right hand top corner.
- Type Process Builder in the Quick find box.
- Click on the process builder.
- Click on the new button and fill out the below fields.
- Process name: Opportunity Follow up Task
- API Name: Opportunity_Follow_up_Task
- The process starts when: It’s invoked by another process
- Click on the object and since we want the task to be associated to an opportunity, we select opportunity as the object and click on save.
- Click on the Criteria node and Select: No criteria—just execute the actions!
- Save the Criteria and click on the ‘+ Add Action’ button and define the Action as below
- Action Name: Follow up task
- Record Type: Task
- Set Field Values:
- Field: Assigned To ID , Type: Field Reference, Value: [Opportunity].OwnerId
- Field: Priority, Type: Picklist, Value: High
- Field: Status, Type: Picklist, Value: High
- Save the action and Activate the Process to use in other processes.
To Call this process from another process, we will use the existing process ‘Opportunity Won’
- Click on the process Opportunity won and click on the clone button to create a new version of this process.
- Click on the ‘+ Add Action’ next to the node Opportunity won and define the Action as below.
- Action Name: Follow up task
- Process: Opportunity Follow up Task
- Set Process Variables
- Process Variable*: SObject
- Type: Field Reference
- Value: [Opportunity]
- Save the action and repeat for the Node Opportunity Closed Lost
The overall Process should look like this.
- Click on save and Activate the process.
For More Examples refer : Automate you Business Process