Apex Aide apexaide

How Agentforce Achieved Accurate Flow Generation Across 461 Billion Monthly Executions Using a Constrained DSL

By Shipra Shreyasi· Salesforce Engineering Blog· ·Advanced ·Developer ·13 min read
Summary

Agentforce’s engineering team enhanced natural-language-to-Flow generation by replacing fine-tuned models with a constrained, multi-stage Domain-Specific Language (DSL) framework. This approach ensures highly accurate, intent-aligned automation across more than 63 Flow types, scaling to over 461 billion monthly executions. They tackled issues like model hallucinations, complexity handling, and slow innovation cycles by enforcing strict constraints and staged validation. Salesforce teams can leverage these architectural insights to build reliable, scalable, and debuggable Flows using natural language prompts.

Takeaways
  • Replace fine-tuned models with a constrained multi-stage DSL to improve Flow generation accuracy.
  • Automate DSL updates from Flow Metadata WSDL to keep pace with evolving Flow schemas.
  • Enforce strict validation at each DSL pipeline phase to prevent invalid Flow configurations.
  • Use automated evaluation frameworks to measure Flow accuracy beyond simple success saves.
  • Eliminate model retraining overhead by leveraging deterministic rule updates with open-source LLMs.

By Shipra Shreyasi, Aniket Kumar, Manas Agarwal, and Pragya Kumari In our Engineering Energizers Q&A series, we highlight the engineering minds driving innovation across Salesforce. Today we spotlight Shipra Shreyasi , a software engineering architect who directs the team enhancing natural-language-to-Flow creation within Agentforce. This empowers users to build production-ready Flow metadata from simple speech while managing automation at a scale surpassing 461 billion monthly executions. Explore how Shipra’s team boosted natural-language-to-Flow precision by swapping fine-tuned models for a restricted, multi-level DSL framework, and how they maintained reliability across 63+ Flow varieties — including Screen Flows, UI elements, and unique actions — through specialized constraints and staged verification.

AgentforceFlow BuilderArtificial Intelligence