Architecture & Data
Scaling Salesforce for high-volume staffing without losing control
Diagnose slow saves, bulk-load failures, row locks and integration backlogs with a transaction-first Salesforce performance guide for staffing teams.
By Gosai Digital · 6 min read
Reviewed
A slow recruiter screen, an import failure and a delayed payroll handoff may have different causes. Treating every problem as “too much synchronous automation” can move the delay elsewhere while making failures harder to recover.
Start with the operation that is failing, the evidence of its failure and the point at which the business needs a trustworthy result. Then change the smallest part of the design that addresses the measured bottleneck.
Item 2: Save placement and required evidence
Decision and pending delivery are durable
Item 3: Commit transaction
Only committed data crosses this boundary
Item 4: Controlled delivery worker
After commit: finite capacity and bounded retries
Item 8: Reporting refresh
Separate branch: agreed freshness window
Profile a real transaction and its surrounding workload
Choose a representative action, such as confirming a placement. Record its elapsed time, automation path, queries, database writes, CPU use, errors and downstream completion. Measure ordinary and busy periods. For a page-load issue, separate browser and component behavior from server-side work rather than attributing all elapsed time to Apex.
Build a short diagnostic worksheet:
| Symptom | Evidence to collect | First design question |
|---|---|---|
| Slow save | Transaction logs, automation sequence, repeated updates | What work must finish before the record is valid? |
| Bulk-load failures | API job results, transaction errors, payload distribution | Which transaction failed and which records actually committed? |
| Row-lock errors | Contended records, parent relationships, concurrent jobs | Are independent updates competing for the same parent? |
| Slow list or report | Query shape, data distribution, filters | Does the query narrow the real production dataset? |
| Integration backlog | Oldest pending item, retries, rate limits, destination response | Is arrival volume exceeding sustainable processing capacity? |
Capture package versions, active automation and test conditions alongside the measurements. Without those, a faster second test may simply reflect a different workload.
Understand the transaction boundary
Salesforce enforces limits on resources used within a transaction. When a Flow transaction exceeds a governor limit, its work is rolled back. An import can consist of multiple transactions, and APIs differ in partial-success and batching behavior. There is no universal rule that the first 150 records save and the rest fail. Inspect the actual results and error context. Per-transaction Flow limits
That distinction matters operationally. Retrying a whole input file after partial success can duplicate downstream work unless identifiers and retry handling are designed for it. A completed import job also needs its failed and unprocessed results reconciled before anyone calls the load complete.
Keep immediate validity checks together
Classify each action by the consequence of delay:
- Required before commit: permission and validity checks, an allowed status transition, and evidence needed to justify an approval.
- Allowed after commit: a notification or external-system delivery whose pending state is acceptable and visible.
- Allowed on a schedule: a reporting projection with an agreed freshness window and a visible “as of” time.
For example, assignment confirmation may require a current eligibility decision. Moving the only decision record or approval timestamp into a background job can leave a confirmed assignment without its justification. Keep that invariant together, or introduce an explicit pending state until the complete process succeeds.
An asynchronous path creates a new failure boundary. Salesforce's asynchronous guidance warns that resources are finite, limits still apply and execution has no guaranteed service-level timing. Model delay and outage behavior before offloading the work. Asynchronous processing decision guide
Simplify automation without building one giant Flow
Inventory automation on the affected object, including managed-package behavior and downstream updates. Look for unnecessary execution on unchanged fields, repeated queries, database operations inside loops and updates that trigger the same process again.
For straightforward same-record changes, evaluate before-save automation. Give record-triggered flows precise entry conditions and deliberate order. Salesforce's current architecture guidance supports modular flows coordinated through Flow Trigger Explorer; merging everything into one Flow is not a general performance remedy. More complex or dense workloads may justify invocable Apex or an Apex-led design, based on maintainability and transaction requirements. Record-triggered automation guidance
Keep the platform's order of execution and existing package contracts in view. Changing an entry condition can alter behavior just as materially as rewriting code. Verify both performance and business outcomes.
A worked load-test scenario
Illustrative workload: an agency imports 1,000 placement updates while recruiters edit active assignments. Many imported records belong to one large client account. This is a test scenario, not a Salesforce capacity threshold.
The original design updates that parent account for every placement change, recalculates a reporting total and initiates a delivery notification. A useful investigation asks whether parent contention, repeated calculations or destination throttling is responsible.
A candidate redesign might:
- Keep placement validation and approved state changes in the originating transaction.
- Record a durable pending delivery item with the committed change.
- Process external deliveries in controlled batches with stable identifiers.
- Refresh a non-critical account reporting total on an agreed cadence.
- Organize loading work to reduce simultaneous writes involving the same parent.
These are hypotheses to test. Asynchronous work can still lock the same parent, so moving identical updates to a queue may preserve the bottleneck. Salesforce recommends considering parent grouping when organizing Bulk API 2.0 loads and explicitly notes that locking depends on the data model. Organizing data to minimize lock contention
Compare the original and revised designs using the same synthetic dataset, concurrent activity and error cases. Record median and tail latency, throughput, lock failures, backlog age and reconciled record counts. Set acceptance criteria from operational needs rather than publishing an unexplained universal save-time target.
Make event processing recoverable
For an event whose consumer needs committed Salesforce data, choose publishing behavior deliberately. Publish Immediately can deliver before the originating transaction commits; Publish After Commit is the relevant alternative when the consumer depends on that commit. Platform-event publication behavior
An event architecture also needs:
- A stable business operation identifier so replay does not repeat side effects
- A durable processing state and outcome, not only an enqueue acknowledgement
- Bounded retries for transient failures and a visible exception path for permanent ones
- Monitoring for publication failures, subscriber lag and allocation consumption
- Reconciliation between committed source changes and destination outcomes
High-volume platform events and change data capture events have a documented 72-hour retention window. Legacy standard-volume platform events have 24 hours; verify the event type in an existing implementation. Platform-event types and retention
Replay IDs locate positions in the stream; they should not be treated as universally unique business identifiers. An outage beyond retention needs another recovery source, such as authoritative records and a controlled backfill. Event message durability
Flow, Apex, Platform Events and Change Data Capture provide capabilities with different limits. A complete retry, exception and reconciliation process is additional design work. A queue alone does not prove delivery.
Optimize queries without making operational data stale
Use selective filters, focused result sets and production-like data volumes. An index is useful only when the optimizer can use it effectively. Salesforce cautions about formula-based filtering and cross-object formulas in large-data queries. Large-data query guidance
There is no defensible fixed saving in milliseconds for removing a formula field. If profiling supports storing a derived value, define its owner, update trigger, repair job and freshness promise. A nightly value may suit a trend report and be unacceptable for a live eligibility or rate decision.
Release with an operational recovery plan
Before rollout, test peak and sustained load, skewed parents, API retries, subscriber outage, expired replay windows and rollback. Agree who can pause processing and how pending work will be reconciled afterward. Monitor both system performance and whether staffing work reaches its intended destination.
Review a high-volume Salesforce workflow with Gosai Digital. Bring an anonymized error sample, the failing action, approximate workload and connected systems. A focused transaction review is a better starting point than a platform-wide rewrite.
Sources and review scope
Reviewed October 9, 2026 against the linked Salesforce architecture and developer documentation. Verify current org allocations and actual API behavior before sizing a solution. All workload values are illustrative; no performance result or guaranteed improvement is claimed.