Skip to main content

Building Agentforce for Flow: How AI Cut Execution Time by 99%

Shipra Shreyasi
Mar 15 - 5 min read

In our “Engineering Energizers” Q&A series, we highlight engineering leaders driving AI-powered automation. Today, we feature Shipra Shreyasi, Software Engineering Architect at Salesforce. She plays a crucial role in the development of Agentforce for Flow, an intelligent automation system that simplifies and optimizes workflow creation within Salesforce. By harnessing AI, Agentforce for Flow boosts efficiency, scalability, and seamless integration.

Discover how her team overcame challenges in metadata interpretation, performance inefficiencies, and AI accuracy, reducing execution time from 10 minutes to just 10 seconds, and ensuring precise, fast, and scalable automation.

What is your team’s mission?

The team focuses on developing AI-driven automation to enhance workflow efficiency, scalability, and accuracy across Salesforce. Agentforce for Flow simplifies automation by enabling natural language-based flow generation and providing AI-powered flow summarization to help users quickly interpret complex flows.

Originally part of Einstein for Flow, the project evolved into Agentforce for Flow as part of a broader AI automation strategy. This transition involved architectural modifications, model retraining, and deep integrations with Salesforce’s AI ecosystem. The team implemented an optimized metadata retrieval process, improved flow logic interpretation, and redesigned AI model workflows to ensure seamless functionality within Salesforce’s intelligent automation stack.

A key milestone for the team was the development of Flow Summarization, a feature that allows users to extract key insights from large, complex flows instantly, reducing manual review time and improving workflow visibility. This feature launched directly to General Availability (GA) without a beta or pilot phase. Extensive internal validation demonstrated high accuracy rates and consistent summarization performance, eliminating the need for a phased rollout. By embedding trust safeguards early in the AI pipeline, security and compliance requirements were met before deployment.

To ensure seamless integration within Salesforce’s broader AI-driven ecosystem, the team enhanced the current Einstein Window in Flow Builder to Agentforce Panel, aligning it with Agentforce. These enhancements allow AI-generated flows to function in real-time conversational style, ensuring smooth integration with Salesforce’s existing automation framework. With these advancements, Agentforce for Flow enables end-to-end AI-powered application development, allowing Salesforce users to automate workflows more efficiently.

What were the biggest technical challenges the team faced when building Agentforce for Flow?

A primary challenge involved handling custom Salesforce metadata. Many organizations create custom objects and relationships that traditional AI models struggle to interpret. Early versions of Agentforce for Flow retrieved metadata on the fly, per Agentforce for Flow Generation API invocation, causing misconfigurations and inaccurate flow recommendations. To solve this, a custom metadata retrieval system was implemented, allowing AI models to dynamically filter and prioritize metadata based on organizational usage patterns. This system reduced irrelevant data processing, ensuring more accurate flow generation while lowering computational costs.

Another major hurdle was performance inefficiency. Early iterations of Agentforce for Flow required up to 10 minutes to generate flows due to large-scale metadata retrieval and slow API interactions. By optimizing API calls, reducing payload sizes, and streamlining metadata filtering, execution time was reduced to 10 seconds, achieving a 3,500% performance improvement.

A key contributor to these optimizations was the introduction of a precision metadata filtering mechanism. Instead of retrieving all metadata upfront, AI models now select only the most relevant objects and fields, reducing payload size from 72,800 bytes to 300 bytes, a 24,000% efficiency gain.

With these improvements, Agentforce for Flow now maintains high-speed execution and scalability, enabling thousands of concurrent requests without performance degradation.

Overview of Agentforce for Flow system.

How did the team improve the accuracy of Agentforce for Flow while handling complex customer objects?

Handling custom Salesforce objects posed significant AI comprehension challenges, particularly in identifying relationships between metadata structures. AI models often misinterpreted non-standard metadata configurations, leading to logical flow inconsistencies.

To improve accuracy, a metadata grounding framework was introduced to ensure only the most relevant metadata was retrieved for flow generation. Instead of processing entire datasets, the AI system prioritizes high-usage metadata, ensuring reliable flow logic recommendations.

Domain-Specific Language (DSL) training was also integrated to enhance AI understanding of Salesforce Flow constructs. By encoding business logic rules directly into AI models, the accuracy of flow generation increased significantly, reducing errors caused by ambiguous metadata structures.

Additional improvements included real-time metadata evaluation using dynamic reference checks, allowing AI models to retrieve contextual relationships on demand. These optimizations resulted in a substantial improvement in AI-generated flow accuracy, particularly for highly customized Salesforce implementations.

How is trust, security, and reliability ensured while rapidly evolving Agentforce for Flow?

Maintaining trust, security, and reliability is a core requirement, especially for AI-driven workflow automation. AI models must process business-critical metadata while complying with Salesforce’s AI Trust & Security framework.

Agentforce for Flow was designed to never use customer data for AI training. Input sanitization protocols remove personally identifiable information (PII) before AI processing, ensuring compliance with data privacy regulations.

To ensure model accuracy, automated validation systems were implemented, requiring each AI update to pass over 1,000 automated test cases before deployment. These tests validate AI-generated flow logic against real-world Salesforce configurations, ensuring error-free automation execution.

Real-time anomaly detection systems continuously monitor AI-generated flows, flagging potential workflow inconsistencies for manual review. These safeguards ensure secure, reliable, and auditable AI-generated automation.

How is Agentforce for Flow future-proofed to handle increasing demand and evolving AI capabilities?

Scaling Agentforce for Flow to support thousands of concurrent users while remaining adaptive to evolving AI automation trends required major architectural enhancements.

A transition to context-aware AI retrieval ensures that AI-generated flows remain dynamic and responsive to changing metadata structures. Instead of relying on static AI models, Agentforce for Flow now adjusts automation logic dynamically, maintaining accuracy as customer workflows evolve.

Distributed processing optimizations and load balancing techniques ensure high-demand AI workloads are efficiently managed across Salesforce’s cloud infrastructure. These enhancements prevent performance degradation, even as user adoption scales.

Research is actively focused on next-generation DSL-based AI models, enabling more advanced workflow automation capabilities. This ensures that Agentforce for Flow remains at the forefront of AI-driven workflow orchestration, adapting to future enterprise automation demands.

Learn more

Related Articles

View all