How to Persist an INSERT Query to the Database During a Workflow Post Function?

We are performing some operations during a workflow post function.

As part of this process, we create a record in the database. However, the record appears to be only held in memory and not immediately written to the database. The actual database insert happens only after the workflow execution is completed.

Is there a way to ensure the data is inserted directly into the database during the post function, without waiting for the workflow to finish?"