Thank you for your reply, Krutik, but the workflow.lib.ftl in question is used by java-end webscripts, not share-end, I do find the workflow.lib.ftl you mentioned as well in share project, which path is:
Which is to say, there are two workflow.lib.ftl files used by java-end and share-end respectively.
I've managed to override the java-end workflow.lib.ftl by manually copying customised version under folder:
and it's working well now, but I couldn't figure out how to do the same thing via module installation, based on your reply, it seems that we're not able to extend or override the lib ftl file, maybe that's the reason why Alfresco doesn't pick my customised ftl from my module although I put it in the same structure as that in tomcat/shared folder.
We have to modify this free marker template as we have a workflow process variable has the below shape:
[[user1, user2], user3, user4]
Unfortunately, the workflow.lib.ftl can't parse this kind of variable as when loop through the variable, it deems all the elements inside a sequence type variable can be convert to a string directly, while in our case, one of elements is sequence again and can't be converted to string directly, which cause an exception is thrown, so we have to modify the template to deal with this case by ourselves.
Anyway, the issue has been solved for me and thank you for your help Krutik.