Source code for compensation is contained in the Saga Hotel Booking example: https://github.com/flowing/flowing-trip-booking-saga/, see also https://blog.bernd-ruecker.com/saga-how-to-implement-complex-business-transactions-without-two-phase-commit-e00aa41a1b1b). I haven’t yet added an example for timeout, but it is easy to do and I added it to my todo list. But don’t expect anything within the next month — as I am currently on leave — sorry. When using Camunda as done in the code example the solution is to use the timer event from BPMN to trigger compensation (see https://docs.camunda.org/manual/7.6/reference/bpmn20/).
PS: Would be cool to get some details about your use case. What is the exact situation where you need “compensation for timeout“?