These are samples of viewer client side API,  you can combine them with one of workflow samples