Agentforce Actions: Where Should the Work Run?
Agentforce selects actions to complete a task; this explainer weighs native record updates against external services so engineers can place each responsibility sensibly.
HerokuAndrew FawcettTutorial
The post shows how to extend Salesforce Agentforce with a Heroku-hosted custom action when customer information remains in older, unstructured cloud archives and requires scalable, real-time processing. It explains that Agentforce selects discrete actions, while Heroku exposes code through External Services using an OpenAPI description of the request and response. The sample uses Java and Spring Boot, an H2 in-memory database, springdoc.org for OpenAPI generation, and Spring AI to convert natural-language questions into SQL before returning results for an Agentforce response. The integration is identified as pilot-only and not intended for production, while the post also points to Heroku Postgres, Heroku Connect, Data Cloud, and pgvector as extensions for other agent use cases.
UltraConstruction’s older invoices are stored in cloud archives as Microsoft Word documents, PDFs, and images. Its Salesforce agents need access to this information without importing it, while employees need answers to invoice-related questions without delays caused by inaccessible data.
Build a custom Agentforce action on Heroku using Java and Spring Boot. The action exposes an OpenAPI-described API through External Services, processes invoice data into an H2 database, uses Spring AI to translate natural-language queries into SQL, and returns the results to Agentforce for a natural-language response.
Agentforce custom actions can be built with Apex or Flow for Salesforce-resident data and modest computational needs; Heroku supports custom actions in other languages and more intensive processing.
Heroku-powered actions are exposed through Salesforce External Services and must describe their request and response using the OpenAPI standard before being imported into Agent Builder.
The sample combines Spring AI with H2: Spring AI converts an Agentforce user’s natural-language question into SQL, which is executed against the in-memory relational database.
Summaries are generated from the original by a language model. Check the original before relying on it.
See the idea
Agentforce selects actions to complete a task; this explainer weighs native record updates against external services so engineers can place each responsibility sensibly.
Keep reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
One useful email. Unsubscribe anytime.