Troubleshoot Prompt Builder
Solve common prompt template issues.
Required Editions
| Available in: Lightning Experience |
| Available in: Enterprise, Performance, and Unlimited Editions with the Einstein for Platform, or Einstein or Agentforce for Sales or Service add-on, or Agentforce Foundations |
My preview or test fails with an error.
If you click Preview and an error appears, such as
Internal Server Error, then check these items before you contact
Salesforce Customer Support.
- Confirm that Prompt Builder is included with your Salesforce edition and add-ons. Supported editions appear at the top of this page.
- Confirm that Einstein is turned on. From Setup, in the Quick Find box, enter Einstein Setup, and then select Einstein Setup. Learn more about enabling Prompt Builder.
- Confirm that you’re assigned the Prompt Template Manager or Prompt Template User permission set, and that the permission set includes Execute Prompt Templates. Learn more about enabling Prompt Builder.
- If you verified Einstein, licenses, and permissions and the error continues, then wait a few minutes and try again. The issue is often a temporary service interruption. Check Salesforce Trust before you create a support case.
My prompt template works in Preview but fails when used in an agent.
A prompt template can generate a response in Prompt Builder and still fail when the same template is called from Agentforce Builder or runs in an agent conversation. The agent can pass different input values than the ones you selected in Preview.
- If the template uses a retriever, then confirm that the retriever’s data source is active and that the retriever returns results on its own. Learn more about individual retrievers.
- If you ground the template with an Agentforce Data Library or unstructured files, then confirm that indexing is complete. Learn more about Agentforce Data Library troubleshooting.
- Preview the template again with the same input values that the agent passes at run time. Learn more about previewing a generated response.
My structured response has missing or blank fields when the Einstein Trust Layer is on.
When the Einstein Trust Layer is on and you use Structured Outputs to generate a JSON
response, some fields can come back empty or null. The Einstein Trust Layer
masks personal information, such as names or email addresses, before it sends the prompt to
the AI model. If a field isn’t restored after the response returns, then it can appear
blank.
In the Response section, open Masking Details and note which fields were masked and whether they contain personally identifiable information. Masked personal information is the most common cause. Learn more about Structured Outputs. To review masking settings, see Einstein Trust Layer Settings.
My prompt template doesn’t use the running user’s data access.
If a template returns data that a user shouldn’t see, or omits data that they should see, then add an Apex or flow action that filters records before that data is grounded in the prompt template. Learn more about adding an action.
My file is too large to use for grounding.
Files used for grounding are limited to 15 MB per request, and most models support at least one file type. If your file exceeds the limit, then split it into smaller files or summarize the content before you upload it as a grounding source. Unsupported files are excluded from the request and listed in the Resolution panel. Learn more about Prompt Builder limits. Learn more about grounding with file inputs.
The Object field is missing.
Whether you see the Object field depends on the prompt template type.
- For a Field Generation template, select an Object and an Object Field when you create the template, before you open the workspace. Learn more about creating a Field Generation prompt template.
- For a Flex template, object resources are optional. Add them later from the Resources tab. The Object field doesn’t appear on the initial setup screen. Learn more about creating a Flex prompt template.
If you expected to see Object immediately and you don’t, then confirm which template type you’re creating.
I get inconsistent results from the same prompt template.
Prompt templates use a large language model (LLM). AI models don’t always return the same response for the same inputs, so results can vary across runs. Templates that use retrievers for classification-style tasks can also fail to parse a response as valid JSON.
- Preview the same inputs more than once to see whether the issue is intermittent. Learn more about previewing a generated response.
- Make instructions specific, and add explicit handling for empty or unexpected values. Learn more about refining a prompt template.
- Don’t repeat the same merge field multiple times. Repeated merge fields can lead to inconsistent results. Learn more about organizing complex prompts.
- If failures are frequent, for example, about one in two runs, then create a support case and include example inputs.
I get an error while resolving data providers.
If you see an error such as Error occurred while resolving data providers; cannot
describe data provider, then an action in the Resources
tab is missing, misconfigured, or unavailable. In Prompt Builder, these resources are called
actions. They include flow, Apex, and retriever actions.
- Open the Resources tab and review each action. Confirm that the referenced flow, Apex class, or retriever still exists and that you have access to it. Learn more about adding an action.
- If you recently renamed, deleted, or deactivated a flow or class, then update or replace the action in the prompt template, and save and preview again.
I can’t delete an input.
You can’t delete an input that’s still referenced by an action. In the Resources tab, remove or update the flow, Apex, or retriever action that uses the input. Then delete the input. Learn more about adding an input.
My resources or flows are missing after I save and activate.
After you save and activate, confirm that you’re viewing the version that contains your resources. Activating a template version makes that version immutable, so it can’t be edited.
- Refresh the page, then use the version dropdown at the top of the Prompt Template Workspace to open the version you just activated. Learn more about using multiple versions.
- Confirm that the resources were saved on the version that’s now active. If you added a flow or Apex action after activation, then save the work as a new version and activate that version. Learn more about activating and deactivating prompt templates.
My prompt template fails to save.
Save-time validation fails when a merge field, action, or required input isn’t valid.
- Check merge field syntax. For example, use
{!$Input:Account.Id}rather than the Winter ’24 syntax{!$account.Id}. Learn more about resource merge field syntax. - Confirm that every required input has a value and that each action in Resources still resolves. Learn more about adding an input.
- If the template uses a flow or Apex class from the Prompt Builder pilot, then recreate those resources for the current syntax. Learn more about flow changes after the pilot. Learn more about Apex class changes after the pilot.
My response is masked, flagged for harmful content, or cut off.
The Einstein Trust Layer scans prompt template responses for toxic language. When toxic language is detected, the harmful content badge appears in the Response section with a warning count. Revise the prompt template and preview again until the warning count returns to 0. Learn more about harmful content notifications.
If the response is cut off, then the resolved prompt can exceed what the AI model accepts. When a prompt is too large, Prompt Builder can generate a summary in the Resolution panel. Use the summarized prompt or shorten the template. Learn more about working with large prompts.
Masked values in the response are expected when the Einstein Trust Layer replaces sensitive data with placeholders and then restores them. Open Masking Details in the Response section to inspect the mapping. Learn more about data trust and masking.
I need to document and debug my prompt templates.
Prompt Builder doesn’t support inline comments in the template body. Use versions to compare changes, and keep a short record of what you changed in each version.
- Click Save As | Save as a New Version before a significant edit so you can compare responses side by side. Learn more about using multiple versions.
- Preview with the same test record each time, and note which instruction or resource you changed.
- For complex logic, test the instruction text in Preview on its own, then add resources and preview again. Learn more about organizing complex prompts.
