governor-limits

Manage Salesforce governor limits in Apex transactions with async offloading strategies.

2|Updated Mar 18, 2026
One-click install
npx skills add https://github.com/bhanu91221/claude-sfdx-iq --skill governor-limits
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: governor-limits
Source: https://github.com/bhanu91221/claude-sfdx-iq/tree/main/skills/governor-limits
Command: npx skills add https://github.com/bhanu91221/claude-sfdx-iq --skill governor-limits

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Reduce and manage Salesforce governor limits within Apex because developers frequently hit per-transaction budget constraints and the need for safe async offloads. This guide provides reference material, practical usage patterns, and concrete techniques to keep code efficient and scalable.

Core Features & Use Cases

  • Per-transaction limit guidance and patterns to minimize SOQL/DML in loops.
  • Practical usage of the Limits class for runtime monitoring and budgeting decisions.
  • Async offloading strategies using Queueable, Platform Events, and batch processing to handle large workloads.
  • Best practices for fault tolerance, testing, and production monitoring of limit consumption.

Quick Start

Apply the provided limits patterns to your Apex triggers and classes to avoid governor limit violations and offload work when approaching constraints.

Frequently Asked Questions about governor-limits

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I avoid Salesforce governor limits when processing large data volumes in Apex?

You can monitor governor limits in Apex using the Limits class to make runtime budgeting decisions before executing DML or SOQL. Querying these limits allows your code to proactively offload work to Queueable or batch processing when approaching per-transaction constraints.

What is the best way to offload Apex processing to async operations when nearing transaction limits?

The best way to offload Apex processing near transaction limits is using async strategies like Queueable, Platform Event decoupling, and batch processing. These patterns safely handle large workloads by distributing DML and SOQL operations across multiple asynchronous transactions.

Can I use Platform Events to decouple logic and bypass governor limits in Apex triggers?

Yes, you can use Platform Events to decouple logic and bypass per-transaction governor limits in Apex triggers. By publishing events, your trigger offloads heavy processing to async subscribers, keeping the initial transaction lightweight and within safe budget constraints.

What are the limitations of relying on Queueable Apex for large workload processing?

Limitations of Queueable Apex include a cap on chained job depth and per-transaction limits still applying to each individual execution. For massive workloads, you must combine Queueable with batch processing and strict runtime limit monitoring to prevent async job overflow.

How do I test and monitor Apex governor limit consumption for production readiness?

Test and monitor Apex governor limit consumption by enforcing limits querying patterns and fault tolerance strategies within your test classes. This ensures your budgeting decisions and async offloads perform correctly under production load without breaching platform constraints.