Create a Prompt Template in the Prompt Builder Setup UI, specifying input fields and grounding context
In Apex invoke the template using the ConnectApi.LlmOpenAiActions.executePromptTemplate method or the equivalent REST endpoint under /services/data/vXX.0/einstein/
Pass a map of merge field values to populate the template inputs at runtime
Parse the response object to extract the generated text from the generations array
Handle rate-limit and token-limit errors; implement retry with exponential backoff as these are external AI service calls
Log input/output pairs for audit purposes given data residency and compliance requirements common in enterprise CRM contexts
Known gotchas
Einstein generative features require specific add-on licenses; calling the API without the required license returns a permission error rather than a meaningful message
Prompt templates that reference CRM record fields require field-level security to be satisfied for the running user or the merge values will be null
Response latency is significantly higher than a standard REST call; Apex callout timeout limits must be raised from the default 10 seconds for longer prompts
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp