The evolution of AI agents—such as Salesforce Agentforce—has been remarkable. However, completing a practical, end-to-end business process using only a single prompt or a simple flow remains extremely difficult in real-world enterprise environments.
I am currently building a Generic Agent Orchestration Framework. In this article, I will explain why such a framework is necessary, using concrete use cases and architectural perspectives.
1. From “Single AI Tasks” to “End-to-End Business Processes”
When integrating AI agents into business operations, the biggest challenges are state management and control of complex dependencies.
Take a seemingly simple task like business card scanning. It does not end with converting an image into text. In reality, the business flow involves multiple interconnected steps:
- AI processing: Analyze the image and extract text
- Web search: Enrich company information and build a profile
- Database matching: Check for duplicates against existing Salesforce records
- Human judgment: Let the user decide whether to create a new Lead or update an existing record
- Data update: Save the final record and write audit logs
Rather than connecting these steps with isolated scripts, a mechanism is required to control them under consistent and centralized state management.
2. Why Is This Framework Necessary? Three Technical Imperatives
① Metadata-Driven Design to Eliminate Hardcoding
Modifying Apex code every time business logic changes does not scale. This framework manages workflows as configuration using custom metadata, such as:
- OrchestrationDefinition__mdt: Defines global workflow settings such as timeouts and logging
- StageDefinition__mdt: Defines step order, execution conditions, and input/output mappings
- AgentDefinition__mdt: Defines AI models, Apex classes, and action types
This approach enables flexible addition and modification of workflows without changing code.
② Unified Support for Multiple Execution Models (Sync & Async)
AI execution time is unpredictable, and external integrations make synchronous processing prone to governor limits and timeouts. This framework seamlessly combines multiple execution models:
- Queueable: Ideal for complex chained processes and data operations
- Future: Used for simple external callouts
- Batch: Handles large-scale data analysis and processing
- Scheduled Batch: Executes periodic reports and checks
- Platform Events: Enables scalable, event-driven integrations
③ Full Visibility and Auditability
In enterprise environments, it is essential to answer the question: “Why did the AI make this decision?” This framework fully records execution logs, error logs, and performance metrics, and includes a state management system that supports retries and recovery.
3. Practical Example: How the Business Card Scanning Agent Works
As a concrete application built on this framework, consider a Business Card Scanning Agent, which orchestrates multiple AI capabilities with different characteristics:
Business Card Scanning Agent: Key Steps
- Image analysis: Extract text from images using Agentforce Multimodal
- Company lookup: Enrich missing company data via web search
- Existence check: Detect duplicates against Salesforce records
- User selection: Allow the user to choose the optimal registration action
- Data sanitization & registration: Protect personal data and create records in the appropriate objects
4. Conclusion: Turning AI into a “Usable System”
Agentforce is a powerful engine. But to run it on the complex roads of enterprise business processes, it needs a solid chassis.
The Generic Agent Orchestration Framework I am building serves exactly this purpose. With metadata-driven flexibility, robust asynchronous processing, and complete audit logging, AI agents can finally leave the laboratory and take on a central role in real business operations.
