Count records between two custom modules (many to many)

Count records between two custom modules (many to many)

I use this article to make a counter records  between two modules.
https://www.blungo.com/blogs/post/function-count-related-records-in-zoho-crm

But when I remove an element, the workflow isn't triggered.