Sub topic 15
Design considerations, limits, and alternatives
This chapter closes the tutorial. It assumes you can build a process with entry criteria, steps, and approvers, and that you know how record locking and the ProcessInstance objects work. Here you decide when a classic approval process is the right tool, which limits to plan for, and what to use instead.
Design considerations
Keep the design simple. Each extra step adds approvers to maintain, emails to send, and places for a record to stall.
- Use few steps and clear criteria. Put the most common path first. Step criteria are evaluated in order, so a broad step placed too early can swallow records meant for a later one.
- Prefer queues and related users over named users. Approvers who leave the company or go on vacation leave a record stuck. Queues, role-based related users, and delegated approvers reduce that risk.
- Decide what happens on rejection. Rejecting can send the record back to the submitter, end the process, or jump to an earlier step. Choose one on purpose and set the final rejection actions to match.
- Plan for locking. A locked record blocks edits from most users, including integrations and Apex DML that run as them. Test any automation that updates a record while it is pending.
- Keep one active process per record where you can. A record can be in only one pending approval at a time. If several processes could match, set their order and entry criteria so only one applies.
Limits to plan for
Check the current Salesforce documentation for exact numbers, because they change between releases. The areas below are where teams usually hit constraints.
| Area | What to watch |
|---|---|
| Processes per object | The platform caps the number of active approval processes per object. |
| Steps per process | A process allows a limited number of steps. |
| Approvers per step | A step has a maximum number of named approvers. |
| Apex governor limits | `Approval.process` calls count toward DML and per-transaction limits, so bulk your requests. |
| Email volume | Email alerts count toward daily email limits. |
In Apex, Approval.process accepts a list of requests. Submit them together instead of calling it in a loop.
List<Approval.ProcessSubmitRequest> requests = new List<Approval.ProcessSubmitRequest>();
for (Id oppId : opportunityIds) {
Approval.ProcessSubmitRequest req = new Approval.ProcessSubmitRequest();
req.setObjectId(oppId);
req.setComments('Bulk submission.');
requests.add(req);
}
List<Approval.ProcessResult> results = Approval.process(requests, false);Passing false as the second argument allows partial success, so one bad record does not roll back the rest. Check isSuccess() on each result.
Alternatives
Classic approval processes fit linear, record-based sign-off. Other tools fit other shapes.
| Need | Consider |
|---|---|
| Complex branching, parallel paths, or approvals on non-standard objects | Flow Orchestrator with approval steps |
| Automation with no human sign-off | Record-triggered Flow |
| Block a save when data is invalid | Validation rule |
| Custom approval screens or external systems | Custom objects plus Apex or Flow |
Exercise
A team wants every discount over 20% approved by a manager, then by finance if it is over 40%. Approvers are often on leave. Name two design choices that suit a classic approval process and one sign that you should use another tool.
Show answer
Use two ordered steps with entry or step criteria on the discount percent, and use related users, queues, or delegated approvers so absences do not stall records. Switch tools if the path needs parallel branches, loops back through several teams, or must run on an object the approval process does not support, which points to Flow Orchestrator.
Exercise
Why should you pass a list of requests to Approval.process instead of calling it once per record in a loop?
Show answer
Each call counts against governor limits such as DML per transaction. A single call with a list is bulk safe, and passing false for the second argument lets valid records succeed even if some fail.