Hello,
You can use asynchronous workitems. You don't really have to implement specific workitem for script A and then another for script B, which is a valid approach but more cumbersome, just create a generic workitem that calls arbitrary java from any class and method passed as parameters.