withStartToCloseTimeout(60) ->withRetryOptions(RetryOptions::new()->withMaximumAttempts(1)) ); $saga = new Workflow\Saga(); $saga->setParallelCompensation(true); try { yield $simple->echo('test'); $saga->addCompensation( function () use ($simple) { yield $simple->echo('compensate echo'); } ); yield $simple->lower('TEST'); $saga->addCompensation( function () use ($simple) { yield $simple->lower('COMPENSATE LOWER'); } ); yield $simple->fail(); } catch (\Throwable $e) { yield $saga->compensate(); throw $e; } } }