How to limit user from approving based on specific condition in workflow

when i have different department under that different roles and when i’m creating a workflow it should go to mentioned department role to approve/reject which is given in table format, and that department is not fixed it can vary any time.kindly guide me to achieve this.

Thanks in advance…

It is only possible to add multiple roles for the same stage.

I think you should create a doctype to dynamically configure worklfow.
Workflow Settings and set config for reference doctype and condition
And then, In Workflow doctype, at condition field get condition by Workflow Settings.

Implementation is up to you.