Section 4 · AI Agents · 35% of exam
4.2 Agent Building Blocks and Agent Script
Exam objective
Describe the main components of an Agentforce agent and explain how Agent Script expresses its workflow and resources.
Agent parts and their jobs
An agent combines a role and purpose with focused topics or subagents, instructions, actions, and supporting resources. The agent definition describes the overall job. A topic or subagent groups a related responsibility, such as answering product questions or handling a return. Its classification description helps the router decide when it applies. Instructions explain what to do and which boundaries to respect. Actions are the tools the agent can invoke. Variables store values for later reasoning, filters, or action inputs. Data sources provide grounding, and channel connections determine how the agent interacts through a particular surface. Treat these as distinct building blocks: instructions guide behavior, while actions perform operations.
What Agent Script expresses
Agent Script is the language used to build agents in the new Agentforce Builder. It combines natural-language instructions for conversational tasks with programmatic expressions for rules and control flow. Script can define conditions, transitions, variable updates, and which subagents or actions are available. It can also control order: for example, verify a customer before making a sensitive account change. Agent Script helps avoid relying solely on an LLM to decide every step. This does not mean every agent must be fully scripted. Use programmatic logic where consistency or policy requires it, while leaving appropriate interpretation and conversation tasks to the reasoning engine.
How resources connect
In a script, references connect behavior to configured resources such as actions, variables, and subagents. An action can accept an input, execute its underlying capability, and return outputs. A variable can hold an output that a later condition or action uses. A transition can move the conversation to another subagent when a condition is met. These links make the agent’s path understandable and controllable. If a business requirement says that one action must run only after another succeeds, make that relationship explicit through a variable, condition, or follow-up transition. Natural-language text alone may not enforce a required sequence reliably.
Build at the right level
Use the simplest configuration that satisfies the use case. A straightforward question-and-answer assistant may need clear instructions, a grounded data source, and a relevant answer action. A process with identity verification, eligibility rules, and record updates may need variables, filters, and explicit transitions. Agent Script supports gradual control rather than forcing a choice between a free-form agent and a rigid workflow. Keep resource descriptions precise, avoid unnecessary actions, and make inputs and outputs understandable. When maintaining an existing agent, inspect both its visible configuration and underlying script so you understand where routing, conditions, and actions are governed.
TIP: If a scenario requires a rule or sequence to be followed consistently, look for an explicit expression, transition, variable, filter, or deterministic action rather than a vague instruction alone.
Salesforce product terms can differ between the new Builder and legacy Builder. The exam guide’s objective language is the primary guide to what AI-201 tests.
Extra concept: Agent Script can be authored in Canvas or Script view; both views represent the same underlying agent configuration.
Official references:
- Agent Script https://help.salesforce.com/s/articleView?id=ai.agent_script.htm&language=en_US&type=5
- Salesforce Certified Agentforce Specialist Exam Guide https://help.salesforce.com/s/articleView?id=005298924&language=en_US&type=1
Key takeaways
- Agent Script combines conversational instructions with programmatic expressions.
- Actions execute work; variables carry values; filters and transitions control availability and flow.
- Add explicit deterministic controls when a business rule or sequence must be consistent.
