Salesforce Agentforce Agent-to-Agent Calling

Enhancing AI-Powered Customer Support

Introduction

With the Spring’25 release, Salesforce has now introduced the new features for Agentforce. Now effectively integrated with Salesforce’s Flows and Apex Class, you can call an agent to complete background or event-driven tasks from anywhere you can call a flow or Apex class.

This feature may look like a simple addition, but it has paved the way for establishing communication between two agents. Now, with the ability for agent-to-agent calling, one AI agent can delegate specialized tasks to another, ensuring efficiency and expertise.

In this blog, we will delve into how the Salesforce agent-to-agent calling can be implemented, potential challenges, and best practices for passing queries effectively.

Why Agent-to-Agent Calling?

With the rapid addition of features in Salesforce Agentforce, the applications for these AI agents have increased tremendously. These applications may range from general FAQs to case-specific escalations. Multiple agents existing in a single Salesforce org, may serve a variety of purposes depending on their needs.

While development takes place, it is always advised to use the resources available cautiously. This implies that instead of using resources to develop a new functionality, the already available ones should be put to use. To implement the same principle, agent-to-agent calling enables the agents to use the functions of other agents serving their own needs.

Benefits of Agent-to-Agent Calling:

  • Improves efficiency: by delegating tasks to specialized agents.
  • Reduces response time: by routing requests to the most relevant agent.
  • Ensures accurate responses: by leveraging agents designed for specific use cases.
  • Enhances scalability: by allowing new agents to be added for different functions.
  • Reduces redundancy: by preventing multiple agents from configuring the same tasks.

Scenario: Linking a General Query Agent to a Service Agent

Use case: A company has deployed two Salesforce AgentForce service agents as:

1. General Query Agent→ handles employee queries related to accounts and FAQs.

2. Service Agent → Specializes in retrieving case details, summarizing cases, and drafting email responses for customer issues.

Agatha is an employee of the company using General Query Agent who needs summaries of the cases for a certain period. She may also need to reply to customers on their queries through emails.

How It Works:

  • When an employee asks the General Query Agent to summarize a case or draft an email response, it delegates the request to the Service Agent using a Salesforce Flow.
  • The Service Agent processes the request, retrieves case details, and returns the response to the Flow.
  • The Flow then sends the response back to the General Query Agent, which delivers the final output to the user.

Working process

  • Case Summary

    Query: The user interacts with the General Query Agent and requests to summarize the case for her.

    Solution: The agent is designed to ask the user for the ID of the case in order to identify the record.

    Example Interaction:

    Example Interaction

    agent calling flow 3

    => We can see in the above interactions that on being invoked for certain topics like case summary, our agent fetches the response from the Service Agent with the help of flow.

  • Case Mail Response Draft

    Query: The user asks the agent to draft an email response for the certain case that is to be sent to the customer in order to update him about the issue he faced.

    Solution : Our General Query Agent identifies the query , and if the details of the case are not present , it asks the user for them. On receiving the information, it transfers the control to the appropriate topic, invoking the required action to call the flow in order to subsequently get an email draft from Service Agent.

    Example Interaction:

    agent calling flow 4

    agent calling flow 5

Working: The General Query Agent invokes a Flow to delegate the request to Service Agent. The Flow then calls the Service Agent to process the request. The response is passed back through the Flow to the General Query Agent, which further delivers the final answer to the user.

Outcome: A seamless AI-driven interaction that ensures employees get accurate case details without needing to interact with multiple systems manually.

Challenges in Implementing Agent-to-Agent Calling

While agent delegation enhances efficiency, it also introduces technical and design challenges.

  • Query Routing Complexity

    The General Query Agent should be properly configured through Topics’ instructions to identify when a query needs to be delegated. Remember to include phrases in the instructions that might trigger a certain topic.

  • Data Context and Formatting

    The response received by Flow from the Service Agent after our request has been processed is in JSON format, as we saw in the above images. Always instruct the agent to format the final response before displaying it to the users.

  • Handling Delays and Errors

    There might arise a case when the Service Agent takes too long to respond or might fail to respond to the request sent to it. In that case, the user using the General Query Agent might be left in the dark. This can be avoided by including error handling measures in the mediator between two agents, which is our Flow.

  • Query Formatting

    If the General Query Agent or Service Agent far along the way, cannot interpret the query correctly, the user experience may suffer. Thus, it advised to always format queries in clear, structured messages . For example- User Query: ‘Help me write an email response to the case with ID ‘500Hs000026dIoTIAU’. Use sender ID as ‘005Hs00000GcHxLIAV’ => Here, one can see that the IDs are mentioned in quotes. This may help the agent further along to identify where the actual data is present in the query.

Conclusion

Salesforce Agent-to-Agent Calling is a powerful approach that allows businesses to create specialized AI agents that work collaboratively. By delegating tasks to the right AI agent, companies can improve efficiency, reduce workload, and enhance customer experiences.

In our use case, the General Query Agent seamlessly calls the Service Agent, ensuring employees receive accurate case summaries and email responses without navigating complex systems.

For additional questions on Experience please reach out to support@astreait.com