I have set up some new Case types and it was all working fine until a user tried to create a case and got the above error, this is happening for all case types now and seems to be being generated by Civirules code.
The only thing I can think of which I have changed recently is I deleted some activity types (through CiviCRM's user interface) and some were likely included in some Case types as sequences or timelines. None of the deleted activity types are included on active Case types that I'm using now but could that be the reason?
Do I need to track down the tables where activity types are linked to cases and get delete rows which are orphaned?