Skip to main content

๐Ÿค– Agentforce Routing: Transition vs. Delegation Explained

๐Ÿ’ฌ In plain words: There are two ways an AI agent can hand off work to another subagent, and they behave completely differently. A transition is a one-way trip—the first agent says goodbye. A delegation is a round trip—the first agent asks a question, gets an answer, and comes back. If you choose the wrong one without understanding the difference, your AI will lose the context of the conversation.

⚡ 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.
๐Ÿ“Œ Real-Life Example: Customer Support Routing

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
  
⚠ INTERVIEW TRAP & DEVELOPER MISTAKE:
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.
Transfer vs. Hold: A transition transfers the call and you are gone. A delegation puts the user on hold, asks a colleague, and comes back.

๐Ÿงญ 360 Card — Transition vs. Delegation

๐ŸŽฏ Rule: Escalate via transitions. Ask questions via delegations. Decide deliberately based on user intent, not by whichever syntax you remember first.

๐Ÿš€ 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

Q: What is the exact difference between a transition and a delegation?
๐ŸŽฏ Say this first: A transition is one-way and immediately discards the built-up prompt. A delegation temporarily runs a subagent and then returns control to the original caller.
  • They might look similar in your script, but they execute completely differently at runtime.
  • When transitioning, the previous subagent's after_reasoning will not run.
  • Delegations act like standard tools. The referenced subagent spins up, does its job, and hands the answer back.

๐Ÿ“ 2-Minute Self-Check

Q1. If left unset in the configuration, what does agent_type default to?

A1. It defaults to Service. Best practice is to always set it explicitly so there is no confusion.

Q2. Can the after_reasoning block contain prompt text?

A2. No. Directive blocks like after_reasoning are meant for logic and routing only, not for conversational output.

Q3. Which orchestration method returns control back to the caller?

A3. Delegation. A transition is always one-way and will discard the built-up prompt.