Agentforce Specialist Certification (Study Guide) Deterministic Logic

Core Concept: Deterministic Logic

In this lesson, we’ll walk through how Agentforce uses variables and filters to create predictable, secure, and reliable agent behavior.

One of the biggest challenges with AI agents is avoiding randomness. In Agentforce, this problem is solved through deterministic logic — logic that behaves consistently every time.

Deterministic logic reduces randomness

Deterministic logic is achieved by combining variables which store information and filters which control when agents are allowed to act.

Understanding Agent Variables

Think of variables as an agent’s memory. They allow the agent to store information, reference it later, and make decisions based on known facts rather than guesswork.

Understanding agent variables

Variables are used throughout Agentforce in instructions, filters, and action inputs to ensure behavior remains consistent and secure.

Context Variables

Context variables represent system-provided data. These values are automatically supplied by Salesforce and cannot be changed by the agent.

Context variables in Agentforce

  • Automatically mapped from the Messaging Session object
  • Include standard and custom fields
  • Read-only by design
  • Always prefixed with $Context, for example: {!$Context.EndUserLanguage}

Conversation Variables

Conversation variables store information that only matters during a single interaction. Once the conversation ends, these values disappear.

Conversation variables in Agentforce

  • Scoped to one conversation session
  • Can be standard or custom
  • Commonly used to track steps, decisions, or temporary user input
  • Referenced using {!VariableAPIName}

Custom Variables

When built-in variables aren’t enough, you can define your own. Custom variables give you full control over how data flows through the agent.

Custom variables in Agentforce

  • Created in the Context Panel
  • Support Text, Boolean, and Number data types
  • Can be set by the Agent API or used by the LLM
  • Can be mapped to action inputs and outputs

Variables: Quick Reference Guide

Agentforce variable types explained

Applying Agent Filters

Once variables are in place, filters define when an agent is allowed to use a topic or perform an action.

Filters control agent actions

You can think of filters as checkpoints. If the required conditions are not met, the agent simply cannot proceed.

  • Control access to sensitive actions
  • Frequently used for authentication and eligibility checks
  • Built using a variable, operator, and comparison value
  • Configured in the Filters tab of the Context Panel

Builder Quick Reference

Builder quick reference slide

Create Custom Variables Context Panel → Variables
Apply Filters Context Panel → Filters
Attach Filters to Topics Topics Panel

Before You Move On

✔ You understand how variables remove randomness

✔ You can explain Context vs Conversation variables

✔ You know how filters control agent access

✔ You recognize how this supports secure agent behavior

Next Up: Filters in Action

Complete this lesson to see how filters are applied in real-world agent scenarios.