In processes.xml, two tenantId are used to associate certain workflows specific to tenantfor example tenantId=tenant1 , resources -> tenant1_workflow.bpmn and tenantId=tenant2 , resources -> tenant2_workflow.bpmn , and using rest api an option is given to create tenants , now how to associate resources/workflow to this tenant? Is it possible?

When you set the tenantId attribute within the deployment descriptor (processes.xml), the deployment is restricted to the given tenant.

If you want to achieve the same goal by using the REST API, it is necessary to create a tenant first (as you already mentioned) [1]. Afterwards you can create a new deployment with the given tenantId [2] so the deployment is restricted to this tenant.

Yes understanding is correctBasically trying to develop different workflows for different tenantsalso next step would be to dynamically change the workflow itself (is this also possible using REST APIs?) if its possible