---
schema_version: "1"
id: 60b942a56a12121020d77d7c7b0b2b9115260976434701895c423eaee9c9e1fd
title: New and Changed Agent Script Functionality
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/release-notes/262-0-0/rn_agentforce_script_new_changed.md
canonical_url: https://help.salesforce.com/s/articleView?id=release-notes.rn_agentforce_script_new_changed.htm&release=262.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: a892e7059106e81fc8200d73051cf97c135cb32f9eb1def376f473c2ff3eebb8
description: Use Agent Script to build agents that blend deterministic logic with the reasoning power of LLMs.
products:
  - Cross Cloud
release: "262"
---
# New and Changed Agent Script Functionality

Use Agent Script to build agents that blend deterministic logic with the reasoning power of LLMs.

## August ‘26

You Must Fix New Agent Script Warnings:

Agent Script errors that were previously accepted now surface as warnings. If your `.agent` file has any of these warnings, you must fix them.

![Important](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-release-notes-salesforce_release_notes-262-0-0-production-enus/e945111b-3e0a-4011-accc-d5949363bfcc/images/icon_important.png)

Important If you don’t fix these warnings, you may not be able to save or commit your agent in a future release when the warnings are promoted to errors.

A `transition` statement must have exactly one target.

Search for these messages:

```
'transition' requires a target. Use 'transition to'.
```

```
'transition' accepts a single 'to' target. Multiple 'to' clauses are not allowed.
```

To fix, ensure your `transition` statements contain a valid target.

Incorrect (no target):

```
if @variables.data_collection_complete == False:
    transition
```

Correct: (transition statement contains a target)

```

    if @variables.data_collection_complete == False:
        transition to @topic.data_collection
```

Incorrect (one transition with two comma-separated targets):

```

    if @variables.escalate == True:
        transition to @topic.order_help, to @topic.escalation
```

Correct (two transitions, each guarded by a condition):

```

    if @variables.escalate == True:
        transition to @topic.escalation
    if @variables.escalate == False:
        transition to @topic.order_help
```

You can only set the value of a declared, mutable variable.

Search for these messages:

```
@utils.setVariables can only assign to declared variables.
```

```
@utils.setVariables can only assign to mutable variables.
```

To fix, use `@utils.setVariables` to set a variable's value. Declare the variable in the `variables:` section, watch for typos in the variable name, and declare the variable as mutable.

Incorrect (`user_nam` isn't declared — the actual variable is `user_name`):

```
variables:
    user_name: mutable string
...
actions:
    set_user_info: @utils.setVariables
        with user_nam=...
```

Correct:

```
variables:
    user_name: mutable string
...
actions:
    set_user_info: @utils.setVariables
        with user_name=...
```

Incorrect (`ContactId` is linked, so `setVariables` can't write to it):

```
variables:
    ContactId: linked string
...
actions:
    capture_contact: @utils.setVariables
        with ContactId=...
```

Correct (declared as mutable, no typos ):

```
variables:
    ContactId: mutable string = ""
...
actions:
    capture_contact: @utils.setVariables
        with ContactId=...
```

You can't chain statements after `@utils.setVariables`.

Search for this message:

```
Actions using @utils.setVariables cannot have transitions or follow-up actions.
```

After `@utils.setVariables` runs and updates the variables, Agentforce returns control to reasoning. Directives chained after `@utils.setVariables` don't run. To fix, add the directive as a separate action.

Incorrect (transition tacked onto the same action.):

```
actions:
    set_issue_details: @utils.setVariables
        with issue_type=...
        with issue_description=...
        transition to @topic.resolution
```

Correct (runs the second action in `after_reasoning`):

```
reasoning:
    instructions: ->
        | Acknowledge the customer's frustration and express empathy.
        | Ask the customer to describe what type of issue they're having and the details of the issue.
        | Once you have both the issue type and description, use {!@actions.set_issue_details} to save them.
    actions:
        set_issue_details: @utils.setVariables
            description: "Capture the details of the user's issue or request."
            with issue_type = ...
            with issue_description = ...
after_reasoning:
    if @variables.issue_type is not None:
        transition to @subagent.Resolution
```

Use `None` (upper case) rather than `none` (lower case) or null to check whether a variable is set.

Search for this message:

```
'none' is not a valid value in AgentScript. Did you mean 'None' (capitalized) for an empty value?
```

```
'null' is not a valid value in AgentScript. Use 'None' for an empty value or '""' for an empty string.
```

To fix, use `None`, with a capital N. Lowercase `none` and `null` aren't valid.

Incorrect: (Lower-case ‘none’)

```
actions:
    escalate_to_human: @utils.transition to @topic.escalation
        available when @variables.EndUserId != none
```

Correct: (Upper-case “None”)

```
actions:
    escalate_to_human: @utils.transition to @topic.escalation
        available when @variables.EndUserId != None
```

Incorrect (a variable’s value can’t be `null`, and you can’t compare a variable against `null`):

```
variables:
    customer_name: mutable string = null
...
actions:
    ask_for_name: @actions.Prompt_For_Name
        available when @variables.customer_name == null
```

Correct (use `None` for "no value"):

```
variables:
    customer_name: mutable string = None
...
actions:
    ask_for_name: @actions.Prompt_For_Name
        available when @variables.customer_name == None
```

Use `True` / `False` (uppercase) rather than `true`/`false` (lowercase) to check boolean values.

Search for these messages:

```
'true' is not a valid value in AgentScript. Did you mean 'True' (capitalized)?
```

```
false' is not a valid value in AgentScript. Did you mean 'False' (capitalized)?
```

Booleans in Agent Script are `True` and `False`, capitalized. Lowercase `true` and `false` aren't valid.

Incorrect: (Lower-case “true” and “false”)

```
variables:
    is_verified: mutable boolean = false
...
actions:
    run_verified_flow: @actions.Do_Thing
        available when @variables.is_verified == true
```

Correct: (Upper-case “true” and “false”)

```
variables:
    is_verified: mutable boolean = False
...
actions:
    run_verified_flow: @actions.Do_Thing
        available when @variables.is_verified == True
```

Agent Script is a structured authoring language and only accepts valid syntax.

You can't include unrecognized text such as typos or unquoted strings, or use `@variables` when the script is expecting `@actions`. Search for these messages, removing text enclosed with “`<>`” such as “`<field>`”:

```
is not a defined value. Bare identifiers are not allowed here.
```

```
is not a valid invocation target.
```

```
Unknown field "<field>" in reasoning action "<action>".
```

Fix typos, quote string literals in variable comparisons, and invoke actions rather than variables.

Incorrect (`pending` isn’t a variable or a string literal):

```
actions:
    follow_up: @actions.Send_Reminder
        available when @variables.status == pending
```

Correct (`"pending"` is a string literal):

```
actions:
    follow_up: @actions.Send_Reminder
        available when @variables.status == "pending"
```

Incorrect (using a variable instead of an action):

```
actions:
    lookup: @variables.chosen_action
        description: "Do the thing"
```

Correct (using an action where it belongs):

```
actions:
    lookup: @actions.Search_Products
        description: "Look up matching products"
```

Incorrect (`descripton` is a typo, `notes` isn't a valid reasoning-action field):

```
actions:
    lookup: @actions.Search_Products
        descripton: "Look up products"
        notes: "TODO wire this up"
```

Correct:

```
actions:
    lookup: @actions.Search_Products
        description: "Look up products"
        label: "Product Search"
```

These blocks can’t be empty: `system:`, `variables:`, `connection:`, and `modality:`.

If you have nothing to configure or declare in the block, omit the declaration from your Agent Script. Search for this message:

```
it has no content and will have no effect. Add configuration or remove the block.
```

Incorrect (empty `system:` block):

```
system:

config:
    developer_name: "MyAgent"
```

Correct (either fill the block in, or delete it):

```
system:
    instructions: "You are a professional support assistant. Help users manage their requests efficiently."

config:
    developer_name: "MyAgent"
```

Variable references in reasoning instructions must be enclosed with `{!...}`, for example `{!variableName}`.

Incorrect — `orderNumber` isn't enclosed with `{!...}`, so Agentforce treats it as regular text:

```
reasoning: |
    Greet the user by their name customerName and confirm their order orderNumber.
```

Correct — the reasoning instructions use `{!@variables.customerName}` and `{!@variables.orderNumber}`, so the values are substituted at run time:

```
reasoning: |
    Greet the user by their name {!@variables.customerName} and confirm their order {!@variables.orderNumber}.
```

## July ‘26

Specify Mutually Exclusive Conditions with else if: [Agent Script Reference: Conditional Expressions](https://developer.salesforce.com/docs/ai/agentforce/guide/ascript-ref-expressions.html)

Use `else if` after an `if` statement to specify mutually exclusive conditions. Previously, Agent Script supported only `if` and `else` logic.

Set the Default Agent User in the New Access Block: [Access Block](https://developer.salesforce.com/docs/ai/agentforce/guide/ascript-blocks.html#access-block)

Define your agent’s default user in the new `access` block with the `default_agent_user` property. The `default_agent_user` property is deprecated in the `config` block.

## June ‘26

Delegate to Another Agentforce Agent with connected\_subagent (Beta): [Connected\_Subagent Blocks](https://developer.salesforce.com/docs/ai/agentforce/guide/ascript-blocks.html#connected_subagent-blocks-beta)

Available the week of May 4. Use the `connected_subagent` block to define a connection to another Agentforce agent in your Salesforce org. Reference the connected subagent as a reasoning action, so that your agent can delegate requests to it.

The ID Variable and Parameter Type Is Deprecated: [Agent Script Reference: Variables](https://developer.salesforce.com/docs/ai/agentforce/guide/ascript-ref-variables.html) and [Agent Script Reference: Actions](https://developer.salesforce.com/docs/ai/agentforce/guide/ascript-ref-actions.html)

Use `string` instead of `id` to store Salesforce record IDs in variables and actions.

Automatic Slot-Filling For Required Action Inputs: [Agent Script Reference: Actions](https://developer.salesforce.com/docs/ai/agentforce/guide/ascript-ref-actions.html#inputs)

When a reference action has a required input that you don’t specify, the LLM provides the input from the user’s message. With automatic slot-filling, you don’t have to explicitly declare required inputs.

## May ‘26

Download Agent Script Documentation in Markdown: [Download Agent Script Documentation](https://developer.salesforce.com/docs/ai/agentforce/guide/ascript-download-documentation.html)

Download Agent Script documentation as markdown files and feed them to your coding agent for accurate syntax and pattern references. If Salesforce Developers search isn’t finding what you need, use an IDE to search the downloaded Markdown files.

End a Session with utils.end\_session: [utils.end\_session](https://developer.salesforce.com/docs/ai/agentforce/guide/ascript-ref-utils.html#utilsend_session)

End an agent conversation with `utils.end_session`. Tell Agentforce to call this utility to terminate the session. For example, after completing a task or when the customer confirms they no longer need help.

Create a Variable List of Objects: [Agent Script Reference: Variables](https://developer.salesforce.com/docs/ai/agentforce/guide/ascript-ref-variables.html) and [Agent Script Pattern: Using List Variables](https://developer.salesforce.com/docs/ai/agentforce/guide/ascript-patterns-var-list.html)

Declare variables with type `list[object]`. Previously, lists only supported primitive types. Lists of objects are useful when working with action outputs that return multiple records, such as order lines or search results.

Clarification on None Checks for Variables: [Agent Script Reference: Variables](https://developer.salesforce.com/docs/ai/agentforce/guide/ascript-ref-variables.html)

Available previously, we added examples of when to use `is None`, `is not None`, and `!= ""`. Check whether a variable has a value by using `is None` or `is not None`. Use `is None` on any variable type. For string variables, you can also check for empty strings with `!= ""`. On strings, combine both checks to handle all empty-value scenarios.

Access Voice Call Properties with Linked Variables: [Agent Script Reference: Variables](https://developer.salesforce.com/docs/ai/agentforce/guide/ascript-ref-variables.html#linked-variables)

Use the `@VoiceCall` namespace in linked variables to access properties of the current voice call. Previously, linked variables only supported `@MessagingSession` and `@MessagingEndUser` sources. Now, you can build agents that reference the voice call ID directly in your agent script.

Nest And and Or Operators with Parentheses: [Agent Script Reference: Conditional Expressions](https://developer.salesforce.com/docs/ai/agentforce/guide/ascript-ref-expressions.html) and [Agent Script Pattern: Using Conditionals](https://developer.salesforce.com/docs/ai/agentforce/guide/ascript-ref-variables.html#linked-variables)

Use parentheses `()` to nest `and` and `or` operators. Parentheses give you precise control over how conditions evaluate.

Agent Script Functionality Changes:

Agentforce now enforces these syntax violations. You may see new errors or warnings reported in existing agents.

- You can’t have duplicate `with` statements. This example causes an error:
    
    ```
    reasoning:
        actions:
            get_info: @utils.setVariables
                # Error: Duplicate with first_name statement
                with first_name = "Alex"
                with first_name = "Sam"
    ```
- You can’t have duplicate `set @variables` statements. This example causes an error:
    
    ```
    reasoning:
        actions:
            lookup: @actions.OrderLookup
                with order_id = @variables.order_id
                # Error: Duplicate set @variables.status
                set @variables.status = @outputs.status
                set @variables.status = @outputs.updated_status
    ```
- In an agent, every variable name must be unique. This example causes an error:
    
    ```
    variables:
        status: mutable string = "active"
        # Error: 'status' is already defined
        status: mutable boolean = True
    ```
- In an action, every input and output name must be unique. This example causes an error:
    
    ```
    actions:
        OrderLookup:
            inputs:
                order_id: string
                # Error: 'order_id' is already defined in inputs
                order_id: string
            outputs:
                result: string
                # Error: 'result' is already defined in outputs
                result: string
    ```