Has Anyone Else Built a State Machine into a Function?

Has Anyone Else Built a State Machine into a Function?

I'm in the process of building a state machine for lead lifecycle management within Zoho CRM, and I'm curious if anyone else has tried integrating a state machine into their Deluge functions, especially considering Zoho’s 12-function cap. I’ve managed to work around the limit by structuring the state machine efficiently, but I’m hitting some questions regarding execution time and functionality.

Specifically, I’m running into a few areas where I’d love to hear from others:

  • How did you categorize your state machines within the 12-function cap?
  • What are the primary use cases for your state machines, and how are they improving your automation or workflow?
  • Has anyone encountered execution limits when running complex logic or functions within a scheduled function?
  • My state machine runs around 83 seconds—should I be concerned about hitting any time caps, or is this within acceptable limits for scheduled functions?

Would love to get some feedback from anyone who has gone down this road, especially if you've built something similarly complex. Any insights or suggestions would be greatly appreciated!