Use Prompt Templates as Actions

Add a prompt template as an action within another prompt template to reuse logic and standardize how responses are generated. Invoke one prompt template from another to build more consistent, modular prompt workflows.

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

What Are Prompt Template Actions?

A prompt template action calls one prompt template from another.

When used as an action, the referenced prompt template runs during execution. It generates a response based on its inputs and that response goes back to the main prompt. Prompt templates can be chained together to create a prompt chain, where each template builds on the previous one.

Why Use Prompt Templates as Actions?

Using prompt templates as actions helps you reuse prompt logic across multiple templates. It standardizes outputs for common use cases and assists in breaking complex prompts into smaller, manageable parts.

Use the Action Output in Your Prompt

Reference the output of the prompt template action in your prompt.

Summarize the following response: {!Prompt_Template_Action_Output}

When the prompt runs, the prompt template action executes and its response becomes part of the final output.

Considerations

  • Only active prompt templates are available as actions
  • Add up to five prompt template actions in a prompt chain
  • Changes to a referenced template affect all templates that use it
  • Prompt template actions help with reuse, but don’t replace other action types like flows or retrievers