We did show how to generate documents in code, however, generating documents in a workflow using SetWordTemplate action proved to be just as elusive.
The problem is that the entity itself does not appear in the list of parameters for the action, making it impossible to generate the document.
As strange as it sounds but:
Entity needs to be enabled for the Business process flows to appear in the list of parameters for the SetWordTemplate action.
Thanks to Matt for raising the issue.