# SagaContext (dapr-sdk-workflows 0.12.2 API)
declaration: package: io.dapr.workflows.saga, interface: SagaContext

Package io.dapr.workflows.saga

# Interface SagaContext

All Known Implementing Classes:
  `DaprSagaContextImpl`

public interface SagaContext
Saga context.

## Method Summary

Modifier and Type
Method
Description
`void`
`compensate()`
Compensate all registered activities.
`void`
`registerCompensation(String activityClassName, Object activityInput)`
Register a compensation activity.

## Method Details

### registerCompensation

void registerCompensation(String activityClassName, Object activityInput)
Register a compensation activity.

Parameters:
  `activityClassName` - name of the activity class
  `activityInput` - input of the activity to be compensated

### compensate

void compensate()
Compensate all registered activities.