How to force an instance to be written to history immediately

I wrote an process (simple for example). Camonda 7.15.0 spring boot / kotlin / postgress / history level = FULL

Process look like
start → service task (java class) → user task → end

In kotlin class i try to get processInstance from historyService

var historyService = execution?.processEngineServices?.historyService
context.initiator = historyService?.createHistoricProcessInstanceQuery()

But at this moment instance not defined in historyList (and in postgres table also)
Also i try to get all instances and chek entire list.

This instance appears in the history service (and in the postgre table) only when it comes to a user task.
How can i force camunda to write instance every bpmn task/service stage?

Temporary a solve it by adding timer after start event (1 second).
I think instance stored at process “stop” stages (user task/external service/timer/messages etc.)
Where can i find desccriptions or complitely list of this stages?

@ivannoff You can configure save points to the service task types to write into database. It is very easy to enforce engine to write the data in db by configuring either of the below properties based on the requirement.




Process will start asynchronously:

Savepoint for service task:


thanks, that’s what i need