document legalization workflow