Hello
WF-BATCH is a background system user which should have SAP_ALL authorization. All background activities related to workflow are executed using this user id.
After calling the BAPI in first step, Did you use commit work (or) commit work and wait.
If you would have used the former one, do the commit work and wait using the FM "BAPI_TRANSACTION_COMMIT" with 4 or 5 seconds as the input in Wait.
Since just commit work is a Asynchronous update and it would have locked the partner.
Regards,
Thanga