What it is
Apex is a strongly-typed, object-oriented programming language that runs on the Salesforce platform. It powers triggers, batch jobs, REST/SOAP APIs, and custom logic that goes beyond what declarative tools like Flow can handle. In the Agentforce era, Apex classes serve as custom actions that agents can invoke.
Why it matters
Apex is how you extend Salesforce beyond configuration. When your business logic is too complex for Flow or your agents need custom actions, Apex fills the gap. It runs natively on the platform with full access to your data and security model.
Key components
- Triggers
- Batch Apex
- REST/SOAP APIs
- Invocable Actions
- Test classes
How it connects
Agentforce agents invoke Apex classes as custom actions. Apex also powers the triggers, integrations, and batch processes that keep your org running.
Good to know
Governor limits are real — Apex code runs in a multi-tenant environment with strict CPU, query, and DML limits. Design for bulk operations from the start.
Related terms
Agent Builder
Salesforce's low-code tool for creating and configuring Agentforce agents — define topics, actions, and guardrails without writing code.
Agentforce
Salesforce's AI agent platform that enables businesses to build, customize, and deploy autonomous AI agents across sales, service, marketing, and commerce.