You are here:
Add Custom Subagents and Custom Actions
The Shopper Agent subagents manage the transactional shopping experience. If you want a capability that isn't in the subagent template, create a custom one.
Custom subagents use their own node so you can define strict, domain-specific behavior. You define content rules, output formatting, URL normalization. Configure the subagent to ask the shopper what to select when there are multiple matches. This subagent also handles language and scope boundaries.
Considerations for custom subagents:
- Keep instructions for domain rules for formatting, verbatim content, and scope. Also, keep cross-cutting brand rules in the shared variables.
- Restrict the agent to only the capabilities that your storefront uses. Retire or remove what you don't need, including a subagent's router route.
- Use a connected subagent to delegate to a separately deployed agent, such as an external support specialist. The external source doesn't inherit the session binding so connect it independently.
Types of actions you can add:
| Action Type | Example Variable | Guidancer |
|---|---|---|
| Prompt-template /RAG actions | generatePromptResponse | Rely on your own content (manuals, policies, knowledge articles), and return a
grounded answer with citations. Retrieval from these sources don't require a resolved
product ID first. Common inputs include outputLanguage for multilingual
responses, and citationMode to define how sources are cited. |
| Invocable actions (Apex) and Flow actions | standardInvocableAction | Call org logic. Create a case, look up an order or account, check business hours or agent availability, set session variables, or contact an external system via a named credential. |
| Utility actions | N/A | Built-in features like @utils.transition (move between subagents), @utils.escalate (human handoff), and @utils.setVariables (capture and store extracted values such as name, email, and language) |
| Multi-step action chains | N/A | Chain actions together the same way |
- Give the subagent a precise description and its own reasoning instructions. Indicate what the subagent handles and what it defers to another subagent. You want clear routing, and topics that don't overlap.
-
Wire it into the router by adding a
go_to_transition instart_agent agent_router. If you remove that route, it disables the subagent. Removing the block entirely retires it. - Include actions, which are the tools that an agent can call.
