> Is their any possibility to insert variables to act_hi_varinst using API once the workflow is inactive?,
No, the history table are for 'audit purposes', so no API will allow you to change it.
However, you can write your own command and execute it via the managementService.executeCommand() method. There, you can get the entityManager for HistoricActivityInstance and insert/change all you like.
> And inserting manually to act_hi_varinst would cause any issue?
No, except changing your audit data…