Your question is a great one: how does one translate a problem into variables, actions, triggers… I’ve written this article with a few examples in increasing complexity and I hope this gives you ideas and strategies to determine these building blocks in your solution: