Sub topic 3
What a Process Builder process does: nodes and actions
This chapter assumes you know Salesforce Setup, objects, fields, and records, and that you have seen Process Builder in an existing org. It describes how a process is built, because you must read each one correctly before you can rebuild it as a flow.
The working model
A process is one automation on one object. It starts from a trigger, then runs a series of criteria nodes. Each criteria node can run actions right away, actions on a schedule, or both.
The start of a process sets two things:
- The object, such as Opportunity.
- When it starts: when a record is created, or when a record is created or edited. A process can also start from a platform event or be invoked by another process.
The "created or edited" option has a setting that matters for migration. It lets the process run again each time the criteria become true, or only the first time.
Criteria nodes
A criteria node decides whether its actions run. You can define it in three ways:
- Conditions are met: one or more field tests, combined with AND, OR, or custom logic.
- Formula evaluates to true: a formula that returns true or false.
- No criteria, just execute the actions: the actions always run.
Nodes are checked from top to bottom. Each node has a setting that decides whether the process stops after that node or goes on to the next one. When a process has many nodes, this setting decides which actions fire for a given record, so note it for every node.
Actions
Each node has immediate actions, scheduled actions, or both. Immediate actions run in the same transaction as the record change. Scheduled actions run later, relative to a date field on the record or to the time of the change.
| Action type | What it does |
|---|---|
| Update Records | Changes fields on the triggering record or on related records |
| Create a Record | Creates a record such as a Task or Case |
| Email Alert | Sends a pre-built email template |
| Post to Chatter | Adds a feed post |
| Submit for Approval | Starts an approval process |
| Apex | Calls an invocable Apex method |
| Flow | Launches an autolaunched flow |
| Quip, Process | Creates a Quip document or starts another process |
Many processes run Update Records on a related record, for example setting a field on an Account when an Opportunity closes. Flow handles this differently, so mark these cases in your notes.
What to record for each process
For every process you plan to migrate, write down:
- The object and the start setting.
- Whether it can run again for the same record.
- For each node, the criteria and the stop-or-continue setting.
- Each action, with its field values and its timing.
Process Builder is stored as a flow definition with the process type Workflow, so it appears in the same list as flows. That detail is useful when you inventory your org in a later chapter.
Exercise
A process has two criteria nodes. Node 1 is set to stop after it runs. A record meets the criteria of both nodes. Which node's actions run?
Show answer
Only node 1's actions run. The stop setting ends the process after node 1, so node 2 is never evaluated.
Exercise
Name two things you must record about a process's start settings before migrating it.
Show answer
The object it runs on, and whether it starts on create only or on create and edit. For create and edit, also record whether it can run again each time the criteria become true.