Variables Specific to Workflow Agent Teams

Expressions contain different types of variables that provide the necessary context. They've a defined set of scopes in workflow agent teams.

Scope Description
Global Values that can be referenced anywhere in the workflow. For example, Current Date, Trigger Type, and variables defined at the workflow level.
Node Values such as the node input variable's value and the output of each node in the workflow.
Trigger Every workflow can have multiple triggers and each trigger will have its own set of inputs.
Here are the types of variables available in expressions that are specific to agent teams of type Workflow:
  • System Variables
  • Workflow Variables
  • User Variables
  • Trigger Variables
  • User-defined Variables
  • Node Variables

System Variables

System Variables are predefined runtime read-only values provided by the application. These variables can be referenced in inputs, agent mappings, and prompts using the {{$context.$system...}} syntax. For example, {{$context.$system.$currentDate}}, {{$context.$system.$inputMessage}}.

Scope Expression Description
Current Date {{$context.$system.$currentDate}} Current system date (ISO format)
Current Date and Time {{$context.$system.$currentDateTime}} Current system time stamp
Trigger Type {{$context.$system.$triggerType}} Trigger that started the workflow
Input Message {{$context.$system.$inputMessage}} Raw user chat input
User Name {{$context.$system.$chatHistory}} Full conversation history for the current session (prior user and assistant turns)

Workflow Variables

Workflow variables are workflow-scoped runtime values that are created and managed within a workflow process.

Scope Expression Description
Workflow Name {{$context.$workflow.$name}} The ID of the workflow being run. The variable is always available at runtime, and remains stable across runs unless the workflow is renamed.
Trace ID {{$context.$workflow.$traceId}} Unique identifier for a specific workflow run instance that's generated per run. This variable is critical for debugging and support.
Conversation ID {{$context.$workflow.$conversationId}} Identifier for the conversation or session associated with the workflow run.

User Variables

User variables are predefined runtime values that describe the user currently interacting with the application or chat. The user's details are available using the {{$context.$user.}} syntax. For example, user name can be retrieved using the expression {{$context.$user.$name}}.
Scope Expression Description
User Name {{$context.$user.$name}} ID of the authenticated user who initiated the workflow execution

Trigger Variables

When a workflow agent team is called by an email trigger or REST trigger, trigger variables are available for use.

  • REST Trigger
    Scope Expression Description
    Triggers > REST > Input > field {{$context.$triggers.REST.$input.<field>}} Specific request field
  • Email Trigger
    Scope Expression Description
    Triggers > Input > subject {{$context.$triggers.EMAIL.$input.subject}} Subject line of the incoming email that triggered the workflow
    Triggers > Input > fromAddress {{$context.$triggers.EMAIL.$input.fromAddress}} Email address of the sender
    Triggers > Input > content {{$context.$triggers.EMAIL.$input.content}} Body of the email
    Triggers > Input > headers {{$context.$triggers.EMAIL.$input.headers}} Full set of email headers
    Triggers > Input > attachments {{$context.$triggers.EMAIL.$input.attachments}} Attachments included in the email

User-defined Variables

In addition to the system provided variables, you can also add variables that can be shared across nodes in an agent team of type Workflow. You can define these variables when creating the workflow agent team, and they're available throughout your agent team's flow. You can use the defined user variables in user questions or conversations.

To add user defined variables, do these steps:

  1. When creating or editing a workflow agent team, select the Variables tab.
  2. Select Add and enter the details:
    • Name: Enter the name for the variable
    • Type: Choose the type, for example, string.
    • Scope: Choose the scope as User Question or Conversation.
  3. Apply the changes and save.

You can now reference the variable using {{$context.$variables.<variableName>}}.

To assign a value for the variable you created, do these steps:

  1. Edit the workflow agent team in which you want to add the user-defined variable.
  2. Add a node of type Logic > Set Variables and enter the details to create the variable node.
    • From the Variables section, select Add.
    • From the Name field, choose the user defined variable you had created.
    • Enter the value for the variable. You can enter a static value, or a dynamic value that's derived from the runtime context.
  3. Save your changes.
Scope Expression Description
Variables > <name> {{$context.$variables.<name>}} Workflow-level variable

Node Variables

  • Node Inputs

    Node inputs are variables used to pass input to the node in the workflow agent team.

    Scope Expression Description
    Entire input {{$context.$nodes.<nodeCode>.$input}} Returns the complete input object passed to the specified node.
    Specific input field {{$context.$nodes.<nodeCode>.$input.<field>}} Returns a single field from a node’s input object.
  • Node Outputs

    Node outputs are variables that contain the output of the node in the workflow agent team.

    Scope Expression Description
    Entire output {{$context.$nodes.<nodeCode>.$output}} Returns the complete output object produced by the specified node (schema-based if defined).
    Specific output field {{$context.$nodes.<nodeCode>.$output.<field>}} Returns a single field from a node’s output object.
      • Use entire input or output objects when flexibility is needed or when passing data to an LLM for reasoning.
      • Use specific fields when doing these actions:
        • Writing conditions
        • Assigning workflow variables
        • Populating email subjects or concise prompts
        • Referencing a field that doesn't exist at runtime resolves to empty or null
  • Node Error Details

    Node error details are variables that are available when a node in the workflow agent team fails and the Error Handler is called. They're scoped to the node that encountered the error.

    Scope Expression Description
    Error information {{$context.$nodes.<nodeCode>.$error.$info}} Detailed error information returned by the failed node
    Error code {{$context.$nodes.<nodeCode>.$error.$code}} Machine-readable error code associated with the node failure
  • Node Execution Status
    Node execution status variable contains the status of the node in the workflow agent team.
    Scope Expression Description
    Node status {{$context.$nodes.<nodeCode>.$status}} Processing status of the node