AI Agents35% of the exam

Deterministic control with variables, filters and expressions

How custom, context and system variables hold agent state, why gate variables default closed and must be set by code, how available-when filters hide actions and subagents, and how conditionals, template expressions and transitions enforce a workflow without action loops.

Official exam objective
Given a use case, manage deterministic behavior for the agent using mechanisms like filters, variables, and template expressions.

~8 min read · 14 practice questions ·

What the exam expects

  • Choose the variable type (custom, context or system) for a piece of agent state, and decide who may set it.
  • Give gate variables a fail-closed default and a deterministic code path that sets them.
  • Use filters (available when) to hide actions and subagents until conditions hold, and know when a conditional transition is needed instead.
  • Write conditional expressions, guard clauses and template expressions so exact values reach the customer.
  • Enforce deterministic transitions and stop action loops.
  • Key terms: custom variable (mutable, agent-owned session state); context variable (linked to an object field such as a Messaging Session field); filter (an available when condition that hides a subagent or action); guard clause (an unconditional precondition check in script); template expression ({!...} that resolves a value inside prompt text).

Key facts

Variable scope
Detail
Defined in the variables block; every subagent can access them
Linked (context) variables
Detail
Can't have a default, can't be set by the agent, can't be an object or list
Visibility
Detail
Custom variables default to Internal; External lets the Agent API set them
System variables
Detail
Predefined and read-only, such as user_input (the most recent utterance) and current_modality
Reference syntax
Detail
@variables.x in logic; {!@variables.x} in prompt text
False values close a filter
Detail
None, False, 0 or an empty string suppress the action
Gate default
Detail
Initialise gate booleans to False so the gate starts closed
No auto-suppression
Detail
The platform doesn't suppress an action after it has been called
is None vs == ""
Detail
is None checks an unassigned value; == "" checks an empty string
Filters vs required flow
Detail
Filters remove options; a conditional transition guarantees the workflow
Sources for this section (6)
  • Why must a gate variable never be set by the LLM?
  • When is a conditional transition better than a filter?
  • Which values close an `available when` gate?
  • Why can't the agent change a context variable mapped to a Messaging Session field?

The questions are free to read. Answers with their sources and self-grading are included with the pack.

Keep reading with the Agentforce Specialist pack

  • Core concepts
  • Exam traps
  • Worked scenario

The pack includes:

  • All 26 lessons of the Agentforce Specialist guide, with reading progress
  • Interactive decision walks and step-by-step sequence steppers
  • Inline practice questions and one-click topic practice (14 questions for this lesson)
  • An official source cited for every claim
  • An AI tutor that answers from the guide
  • Unlimited timed practice exams

Practice for the Agentforce Specialist exam