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

Key Takeaways

  • 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:

ProblemWhat it looks likeHybrid reasoning fix
Context clashConflicting instructions produce unexpected behaviorUse conditions so only the instructions that apply are resolved into the prompt
Context confusionToo much irrelevant content or too many tools slows the agent and makes it inconsistentFilter subagents and actions with variables, so the LLM sees only what's relevant now
Context poisoningIncorrect or outdated information erodes trustLoad 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

  1. Predictability for critical steps. Identity verification, eligibility checks, and required lookups run every time.
  2. Smaller, more relevant prompts. Only the instructions that apply are resolved, which improves accuracy and reduces latency.
  3. Reliable sequencing (action chaining). You can guarantee action A runs before action B and pass A's output into B through variables.
  4. Flexible conversation. The LLM still handles phrasing, clarifying questions, and judgment where rules don't apply.
  5. 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 featureWhat it does
BlocksSummarize Agent Script into readable pieces that expand to show the underlying script
/ shortcutInserts inline actions: conditional statements, transitions, set a variable, run an action
@ shortcutInserts resources: subagents, actions, and variables, which resolve like merge fields
Actions available for reasoningHolds utilities (transition, escalate, set variables), filters ("Make this action available when:"), and follow-up actions ("After this action is run:")
ConsoleLists errors and warnings. You can commit with warnings but not with errors
Agentforce assistantGenerates or refines Agent Script from natural-language requests; you accept or decline changes
MarkdownFormats 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

StateWhat you can do
DraftEdit, save, preview in Simulate or Live Test mode. You can't activate a draft
CommittedA snapshot saved to metadata, similar to a Git commit. It can't be edited and can be activated
New draft from a committed versionContinue 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 BuilderNew Agentforce Builder
Authoring modelTopic fields (classification description, scope, instructions) and action settingsAgent Script, shown in Canvas and Script views
Deterministic controlFilters and variables in a Context panelLogic instructions, filters, transitions, follow-up actions, after_reasoning
Creating new agentsNot available starting the week of July 13, 2026Where new agents are built
Newer featuresLimited (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.
Test Your Knowledge

What does Salesforce mean by hybrid reasoning in Agentforce?

A
B
C
D
Test Your Knowledge

An admin editing in Canvas view wants to insert an if/else condition into a subagent's reasoning instructions. Which shortcut opens the inline actions menu?

A
B
C
D
Test Your Knowledge

A developer makes changes in Script view and can no longer open Canvas view. What is the most likely explanation?

A
B
C
D
Test Your Knowledge

An agent draft passes preview testing. What must happen before the agent can be activated?

A
B
C
D