Recommendation for Compensation handling in case of failure

Would like some recommendations on how to handle compensation when the service you are trying to call during the compensation is down.

For example, let’s say I have service A,B,C,and D.

I need B and C to rollback on any exception of D.

Now, happy path is that all services (B and C) are up during the compensation phase and can be called when D fails.

But, what if those two services are down?

How can we guarantee that the compensation happens at a later date (near future)?

I can think of a few things but not sure if it’s correct.

  1. Setup separate “CompensationActivities” for both B and C and let them retry infinitely so we don’t block the main workflow and kick off a new child-workflow with those activities?

or

  1. Let the workflow run indefinitely blocked on the “compensate” methods defined in the B and C activities while they retry over and over?

My use case is one I posted before about our GiftCard service and needing to make sure that the customers balance is repaired during any system errors, even if the GiftCard service is down for a while, I need Temporal to make sure that when the service comes back up it can continue the “compensation” actions long after the workflow was started.

Any ideas/examples?

I’m still learning Temporal so sorry for any simple questions…

I would go with 2. There is no problem keeping the workflow open for a long time.