⚡ 1-Minute Summary (Key Points)
- Transitions are permanent: When an agent transitions, control does not return. Any prompt instructions built up by the first agent are immediately discarded.
- Delegations are temporary: When an agent delegates, it references a subagent like a tool. The subagent runs, and then control returns to the original agent.
- Syntax location matters: You must use the "bare" transition format inside directive blocks (like
before_reasoning), but you must use the utility format (@utils.transition) inside tools. - Rule of thumb: Escalate to a human or a completely different workflow using a transition. Ask a specialized subagent for specific data using a delegation.
Imagine your AI agent is handling a billing issue.
• Transition: The customer is angry and wants to speak to a manager. The AI transitions to the escalation routing agent. The AI hangs up and does not come back.
• Delegation: The customer asks a complex question about international tariffs. The AI puts the customer on hold, delegates the question to the tariff subagent, gets the answer, and comes back to finish processing the billing payment.
🧠 Deep Dive: How the Flow Works
To orchestrate multiple agents successfully in Salesforce Agentforce, you need to understand exactly what happens to the conversation state when you pass the baton.
- The One-Way Transition: Once an agent transitions, it wipes the slate clean. It discards the prompt instructions built up by the previous subagent. After the new subagent finishes its job, the system waits for the user's next message and routes back to the main
start_agent. - The Delegated Return: A direct subagent reference delegates the task. Once the referenced subagent is done, control hands right back to the caller so it can continue its workflow.
- Nested Transitions: If a delegated subagent contains a declarative transition inside of it, the flow will follow that new path to the very end before finally returning to the original caller.
💻 Syntax Breakdown
The code you write changes depending on where you are writing it. Never mix these up, or the AI will throw an error.
Reaching another subagent in Agentforce
├─ TRANSITION (One-way. Prompt discarded. No return.)
│ before/after_reasoning → transition to @subagent.x
│ reasoning.instructions → transition to @subagent.x
│ tools → @utils.transition to @subagent.x
│
└─ DELEGATION (Round trip. Runs and returns to caller.)
Direct @subagent.x reference in tools
Do not use one transition syntax everywhere! A "bare" transition (e.g.,
transition to @agent) belongs strictly in directive blocks and procedural instructions. The utility form (@utils.transition) belongs only in tools. Mixing them up will break your deployment.
🧭 360 Card — Transition vs. Delegation
🚀 Gain: Conversations continue exactly where they should, and end when they are supposed to, creating a seamless user experience.
💰 Price: You have to memorize two distinct syntaxes and behaviors, and ensure they are placed in the correct builder blocks.
🛑 Limits: Because a transition discards the previous subagent's built-up prompt context, it will skip any
after_reasoning logic tied to the first agent.🔮 The Future: Multi-agent orchestration is rapidly expanding across Agentforce, allowing complex webs of specialized agents to hand off work securely.
🙋 Core Q&A & Self-Check
- They might look similar in your script, but they execute completely differently at runtime.
- When transitioning, the previous subagent's
after_reasoningwill not run. - Delegations act like standard tools. The referenced subagent spins up, does its job, and hands the answer back.
📝 2-Minute Self-Check
agent_type default to?A1. It defaults to Service. Best practice is to always set it explicitly so there is no confusion.
after_reasoning block contain prompt text?A2. No. Directive blocks like after_reasoning are meant for logic and routing only, not for conversational output.
A3. Delegation. A transition is always one-way and will discard the built-up prompt.
Comments
Questions, corrections and your own experience are all welcome.
Post a Comment