Lesson 13 of 14 · All lessons

Section 5 · Testing, Debugging, and Deployment · 20% of exam

5.2 Flow Tests, Debugging, and Platform Monitoring

3 min read Updated Nov 16, 2026

Exam objective

Test Flow paths and data changes, diagnose system issues, and monitor Flow execution, performance, asynchronous work, and batch jobs.

Test Flow paths before activation

Test a Flow with sample records that exercise every decision outcome, including the default path. For a record-triggered Flow, test both the event that should meet entry conditions and a similar record that should not. If the Flow responds to a transition, test the old and new values. Use Flow Builder's debugger for supported Flow types and Test Mode for record-triggered and autolaunched scenarios as documented by Salesforce. Automated Flow testing can assert expected results where the feature is available; verify its status and setup instructions in current Help because some testing functions are release-dependent or identified as Beta.

Avoid using real customer records during initial testing. Sample data reduces the risk of unintentionally changing live records or sending an email to a real contact. Test fault paths, missing values, permissions, boundary values, and loops over collections. A Flow that works as an admin may fail for the actual user because of access or execution context. Test using the intended user or a controlled user with the relevant permissions.

Use logs to find the first failure

For Apex, reproduce the issue with a known user and record, then inspect the debug log for method entry, SOQL, DML, limits, exceptions, and execution sequence. For Flow, review the interview details, failed-flow email, debug output, and relevant paused or failed interviews. Identify the first step where the actual path diverges from the expected path. Looking only at the final error message may miss the earlier condition or permission failure that caused it. Use a repeatable diagnostic method: 1. State the exact input, user, and expected result. 2. Reproduce in a sandbox or other safe environment. 3. Locate the first unexpected value or branch in the log or interview. 4. Check permissions, entry conditions, and the save-order interactions. 5. Change one likely cause, rerun the scenario, and add regression coverage.

Monitor asynchronous and batch work

Asynchronous work can fail after the initiating user action has completed. Review the relevant job record or setup page for status, progress, errors, and processed counts. Batch Apex can process large data volumes in chunks, and a failure in one chunk may have different consequences from a synchronous transaction. Queueable and scheduled jobs also need monitoring and thoughtful retry behavior. Do not assume that a successful enqueue means the business operation completed successfully.

Performance diagnosis should distinguish slow queries, excessive CPU, large heap use, repeated Flow interviews, inefficient loops, and contention or locking. Use logs and platform monitoring to find the limiting resource. A Flow that repeatedly updates the same record can create a chain of interviews; Apex that loads excessive data can use heap or CPU even when its query count is low. The symptom “slow” does not identify the cause, so inspect the relevant execution evidence.

Salesforce documentation and monitoring screens evolve. Prefer current Salesforce Help for Flow test availability and current developer documentation for logs, limits, and job inspection methods.

Extra concept: observability closes the feedback loop

Logging and monitoring are useful only when they help someone respond. Capture enough context to identify a failed business operation, but avoid logging secrets or unnecessary personal data. Define an owner and response path for recurring failures, and monitor outcomes after deployment.

Key takeaways

  • Exercise each Flow branch, fault path, boundary, and user context with representative test data.
  • Debug from the first unexpected step using logs, Flow interviews, and job records.
  • Asynchronous submission is not completion; monitor outcomes, performance signals, and failures after the initiating transaction.
  • Official references:
  • Salesforce Certified Platform Developer Exam Guide: https://help.salesforce.com/s/articleView?id=005298965&language=en_US&type=1
  • Testing a Flow before activation: https://help.salesforce.com/s/articleView?id=sf.flow_test.htm&language=en_US&type=5
  • Flow debugger: https://help.salesforce.com/s/articleView?id=sf.flow_debugger.htm&type=5
  • Flow testing in Test Mode: https://help.salesforce.com/s/articleView?id=sf.flow_test_mode.htm&type=5
  • Apex debugging: https://developer.salesforce.com/docs/platform/apex-dev/references/apex-dev/apex-debugging.html
  • Apex governor limits: https://developer.salesforce.com/docs/platform/apex-dev/references/apex-dev/apex-gov-limits.html
  • Batch Apex: https://developer.salesforce.com/docs/platform/apex-dev/references/apex-dev/apex-batch-interface.html

Check your knowledge

Answer exam-style Testing, Debugging, and Deployment questions with answers and explanations.

Practice Testing, Debugging, and Deployment
Finished this lesson? Mark it complete to track your progress.

Ready for the real exam?

Take the timed Salesforce Platform Developer simulator: same number of questions, same time limit.

Get Complete Access