Build intelligent prompt templates with conditional logic using the new Block Editor experience.
Authors can now add if, else if, and else statements directly within prompts to
create branching logic based on input variables. Built on Jinja templating syntax, conditions
support comparison operators and can reference merge fields from grounded data. The visual
block-based interface makes it easy to structure complex conditional flows without writing raw
syntax, enabling more sophisticated and context-aware generative AI interactions.
Where: This change applies to Lightning Experience in Enterprise, Performance, and Unlimited editions with the Foundations and the Agentforce for Sales or Service add-on, or included in Agentforce 1 Editions. Generative AI is available in Lightning Experience.
Note: This release is in preview. Features described in this document don't become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can't guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
When: This feature is available starting the week of June 8, 2026.
Why: Conditional expressions enable dynamic prompts that adapt to context. For example, adjust tone based on customer tier, include or exclude information based on case priority, or tailor responses based on product type, all within a single template.
How: To enable the block-based prompt editor, from Prompt Builder Settings, Turn on the
Conditional Logic for Prompt Templates (Beta) toggle. In the Prompt Builder Block Editor, use
the slash command / to insert conditional blocks, enter your conditions, and add content for
each branch.