Urgent.News

What's breaking now, across thousands of outlets.

Tech

CRM'de iş akışı motoru tasarlamak: Olay-koşul-eylem, gecikmeli adımlar, döngü koruması ve sürümleme

"Yeni lead gelince temsilciye bildirim gönder, iki saat içinde aranmazsa yöneticiye haber ver, üç gün içinde randevu oluşmazsa WhatsApp hatırlatması at." Bu cümle bir satış müdürü için tek bir kuraldır. Bir geliştirici için ise aynı cümlenin içinde bir olay dinleyicisi, bir zamanlayıcı, iki koşul kontrolü, iki dış sistem çağrısı ve en az üç farklı hata senaryosu vardır. Ben Koray Yalçın; lead…

A good CRM workflow engine requires a clear event-condition-action model. An event is triggered when something happens, like a new lead being created or a deal stage changing. The condition determines if the event is relevant to a specific rule. Finally, the action defines what needs to be done, such as creating a task, updating records, or sending notifications.

The key is to store rules in a table, allowing them to be edited through a UI, versioned, and tested. This makes it easy to update rules without needing to deploy new code or risk downtime.

To prevent race conditions, a unique constraint is added to the workflow_runs table. This ensures that if the same event is processed twice, only one run will be created, avoiding duplicate processing.

Instead of simply waiting, a more efficient approach is to update the run status to "waiting", record the wake-up time, and let a separate monitoring process wake up the run when the specified time has passed. This prevents long waits from accumulating and ensures efficient use of resources.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

More from Wednesday 28 October →