The Lead Eligibility Flow is a centralized, logic-driven Lead Eligibility Engine that dynamically manages agent lead-claiming permissions by evaluating real-time performance metrics, training compliance, and activity thresholds.
Tools: Record-Trigger Flows, APEX Scheduled Job, Custom Object, Custom Fields, Formula Variables
Prior to this implementation, the logic governing agent eligibility was fragmented across multiple deprecated Salesforce tools, including Process Builders and Workflow Rules. This fragmentation made it difficult to audit why an agent was locked out of the system and created a significant maintenance burden. Furthermore, the business required a way to enforce strict quality standards, such as follow-up consistency and training recency, to ensure that high-value leads were only routed to active, compliant, and high-performing agents.
I consolidated all disparate legacy logic into a single, high-efficiency Record-Triggered Flow. This "Lead Eligibility Engine" acts as a real-time gatekeeper for the agent roster. By integrating with a scheduled Apex job that calculates complex performance data hourly, the solution provides an automated, "hands-off" approach to user management. It not only protects lead integrity by enforcing claiming limits and performance hurdles but also improves agent transparency through automated, real-time email notifications regarding their eligibility status.
The system operates on a two-tier architecture: an hourly Apex job and a sophisticated Record-Triggered Flow. The Apex job performs the "heavy lifting" by aggregating data across lead and transaction records to calculate overdue percentages, 7-day rolling claim counts, and total closed deals for each agent. When these metrics are updated on the "People" record, the flow is triggered to evaluate the agent against a complex matrix of requirements. Using advanced formula variables, the flow checks if an agent’s training is older than one year (unless they meet the "3-deal" veteran exemption), ensures their Sphere of Influence (SOI) is imported, and verifies that their overdue follow-up rate remains below 25%. Once the flow determines the agent's standing, it updates the eligibility status on the record and, if a change occurs, dispatches a custom email alert to the agent detailing their current status and any necessary corrective actions.