Study guide

1.3 Hybrid Reasoning: Agent Script in Canvas View and Script View

Salesforce Certified Agentforce Specialist Exam

Track your progress as you read

Finished sections get a check mark.

1 Chapter 1: Exam Overview & How Agentforce Agents Work

1.1 Agentforce Specialist (AI-201) Exam Facts & Spring '26 Blueprint 1.2 How an Agent Works & the Building Blocks of Agent Script 1.3 Hybrid Reasoning: Agent Script in Canvas View and Script View

2 Chapter 2: Deterministic Control, Topics (Subagents) & Actions

2.1 Deterministic Behavior: Filters, Variables & Template Expressions 2.2 Standard and Custom Topics (Subagents) 2.3 Standard and Custom Agent Actions

3 Chapter 3: Agent Types, Security Context, Channels & Agent API

3.1 When to Use an Employee Agent or a Service Agent 3.2 Security Context: Who the Agent Runs As and How It Affects Actions 3.3 Connecting Agents to Channels: Digital Experiences, Email, Voice & Slack 3.4 When to Use the Agent API

4 Chapter 4: Prompt Builder Fundamentals

4.1 When to Use Prompt Builder 4.2 Access Controls Governing Prompt Templates 4.3 Prompt Template Types: Field Generation, Flex & More 4.4 Creating, Activating & Executing Prompt Templates

5 Chapter 5: Grounding, Prompt Best Practices, Trust Layer & Model Access

5.1 Choosing the Right Grounding Technique 5.2 Best Practices for Writing Effective Prompts 5.3 Einstein Trust Layer Security and Privacy Features 5.4 Managing and Preventing Access to Specific Models

6 Chapter 6: Data 360 Fundamentals for Agentforce

6.1 Agentforce Data Library: Types and Concepts 6.2 Chunking: Breaking Content Into Retrievable Units 6.3 Indexing and Search Types: Vector, Hybrid & Keyword 6.4 Retrievers: Individual, Ensemble & Filtered Retrieval

7 Chapter 7: Testing Agents with Testing Center

7.1 Testing an Agent with Testing Center 7.2 How Testing Center Evaluations Work

8 Chapter 8: Deploying Agents and Prompt Templates

8.1 Deploying an Agent from Sandbox to Production 8.2 Deploying Prompt Templates from Sandbox to Production

9 Chapter 9: Governance and Observability

9.1 Managing and Monitoring Agents 9.2 Agent Analytics and Agent Optimization

10 Chapter 10: Multi-Agent Orchestration, MCP & A2A

10.1 When a Multi-Agent Architecture Is Appropriate 10.2 Open Multi-Agent Protocols: MCP and A2A

1.3 Hybrid Reasoning: Agent Script in Canvas View and Script View

Key Takeaways Explain This Topic AI

Hybrid reasoning mixes deterministic logic and natural-language prompt text in the same Agent Script instruction block.

Agentforce Builder opens agents in Canvas view, which summarizes Agent Script into blocks and uses / for inline actions and @ for resources.

Script view lets advanced users edit Agent Script directly with syntax highlighting, autocompletion, and validation.

Edits are consistent across Canvas and Script views, but Script view changes with errors can make Canvas view unavailable until fixed.

An agent version must be committed before activation, and committed versions can't be edited; you create a new draft instead.

Last updated: September 2026

1.3 Hybrid Reasoning: Agent Script in Canvas View and Script View

Quick Answer: Hybrid reasoning is Salesforce's term for combining programmatic expressions (conditions, variables, transitions, deterministic actions) with natural-language instructions in the same Agent Script block. Logic handles workflow and business rules predictably, and the LLM handles conversation. Agentforce Builder exposes the same script in Canvas view (a visual, block-based editor) and Script view (direct code editing).

Why Hybrid Reasoning Exists

Prompt-only agents create a familiar enterprise problem. You can instruct an LLM to verify a customer before sharing order details, but you can't guarantee it will follow that sequence every time. Adding more instructions often makes things worse. Salesforce's context-engineering guidance names three failure patterns:

Problem What it looks like Hybrid reasoning fix

Context clash Conflicting instructions produce unexpected behavior Use conditions so only the instructions that apply are resolved into the prompt

Context confusion Too much irrelevant content or too many tools slows the agent and makes it inconsistent Filter subagents and actions with variables, so the LLM sees only what's relevant now

Context poisoning Incorrect or outdated information erodes trust Load authoritative data with deterministic actions and store it in variables

Components of hybrid reasoning

Logic instructions ( -> ): if / else conditions, run actions, set variables, and transition to another subagent. They execute in order, exactly as written, before reasoning.

Prompt instructions ( | ): natural-language guidance, personalized with template expressions such as {!@variables.member_name} .

Reasoning actions : tools and utilities the LLM may choose, including transitions, escalation, and setting variables. Each can carry a filter ( available when ).

Variables : reliable state storage, so the agent doesn't depend on the LLM remembering a value.

after_reasoning : deterministic logic that runs after the reasoning loop, such as a mandatory transition.

Model override : a subagent can use a different model than the agent default. Model override is available only for agents created in the new builder.

Benefits the exam expects you to explain

Predictability for critical steps. Identity verification, eligibility checks, and required lookups run every time.

Smaller, more relevant prompts. Only the instructions that apply are resolved, which improves accuracy and reduces latency.

Reliable sequencing (action chaining). You can guarantee action A runs before action B and pass A's output into B through variables.

Flexible conversation. The LLM still handles phrasing, clarifying questions, and judgment where rules don't apply.

Easier troubleshooting. Deterministic paths are visible in the script and in the trace.

A Before-and-After Example

Prompt-only instruction (fragile): | If the customer is a Gold member and their order is more than 30 days old,

| offer store credit. Otherwise explain the return policy.

| Always check the loyalty tier first.

The LLM has to remember to check the tier, interpret "more than 30 days," and choose a branch.

Hybrid version (reliable): reasoning:

instructions: ->

if @variables.loyalty_tier == None:

  • run @actions.get_loyalty_tier
  • with contact_id = @variables.ContactId
  • set @variables.loyalty_tier = @outputs.tier

if @variables.loyalty_tier == "Gold":

| Thank {!@variables.customer_name} for being a Gold member.

if @variables.days_since_order > 30:

| Explain that the order is outside the 30-day window and offer store credit.

else:

| Offer to start a return with @actions.create_return.

The lookup always happens and the date rule is applied by logic. The LLM receives only the one or two sentences that apply to this customer.

Canvas View

When you open an agent in Agentforce Builder , it opens in Canvas view . You see a view-only visual summary of the agent's details, router, and subagents. To edit, open a subagent or action page, or switch to Script view.

  • Canvas feature What it does
  • Blocks Summarize Agent Script into readable pieces that expand to show the underlying script
  • / shortcut Inserts inline actions : conditional statements, transitions, set a variable, run an action
  • @ shortcut Inserts resources : subagents, actions, and variables, which resolve like merge fields

Actions available for reasoning Holds utilities (transition, escalate, set variables), filters ("Make this action available when:"), and follow-up actions ("After this action is run:")

Console Lists errors and warnings. You can commit with warnings but not with errors

Agentforce assistant Generates or refines Agent Script from natural-language requests; you accept or decline changes

  • Markdown Formats instruction text; pasted Markdown is supported
  • Script View

Script view is for advanced users who want to write Agent Script directly, with syntax highlighting, autocompletion, and validation . Key rules:

Your configuration is consistent across both views ; they're two representations of the same script.

On save, the builder validates both views. Errors are underlined in Canvas, and Script view shows more detail.

Some Script view changes can make Canvas view unavailable until you fix the errors in Script view.

On macOS, Option+M switches between views.

Developers can also work outside the browser: Agentforce DX retrieves the .agent file into a Salesforce DX project for VS Code, where the extension supports Agent Script editing and validation.

Loading diagram... One Agent Script, several ways to edit it

Versioning in the New Builder

  • State What you can do
  • Draft Edit, save, preview in Simulate or Live Test mode. You can't activate a draft
  • Committed A snapshot saved to metadata, similar to a Git commit. It can't be edited and can be activated
  • New draft from a committed version Continue iterating; compare versions and copy improvements between them

A version must be committed before it can be activated . To change a committed or active agent, create a new draft, test it, commit it, and then activate it.

Legacy Builder vs. New Builder

Legacy Agentforce Builder New Agentforce Builder

Authoring model Topic fields (classification description, scope, instructions) and action settings Agent Script, shown in Canvas and Script views

Deterministic control Filters and variables in a Context panel Logic instructions, filters, transitions, follow-up actions, after_reasoning

Creating new agents Not available starting the week of July 13, 2026 Where new agents are built

Newer features Limited (for example, voice agents, MCP tools, and multi-agent orchestration require the new builder) Supported

Exam Traps

"Hybrid" doesn't mean two separate agents. It means logic and prompts in the same instruction block.

Canvas and Script views aren't separate configurations. An edit in one appears in the other.

You can't activate a draft. Commit first.

Put sensitive business rules in logic or in the action itself, not in prompt text alone. Salesforce's guidance is that instructions are nondeterministic and don't replace coded business rules.