Also the planner's estimate for table:res_users is off by 1300x..so you should probably vacuum analyze it then recheck. I don't think we know what version postgres you have, but last week's patch releases include a fix which may be relevant (reltuples including dead tuples).
Also I don't know the definition of this table or its indices: tms_workflow_history
..but it looks like an additional or modified index or maybe clustering the table on existing index might help (active? is_final_approver?) Or maybe this should be 3 separate indices rather than composite index? Perhaps some of those could be BRIN indices, depending on postgres version