Skip to main content

Recording Failures

const step = thread.step('payment_processed');

try {
  const payment = await processPayment(orderId);
  await step.addContext(payment).success();
} catch (error) {
  await step.failed({ 
    message: error.message,
    errorCode: 'PAYMENT_FAILED',
    retryable: true
  });
}

Retry Tracking

Each retry attempt is automatically tracked in step history for debugging.

Next Steps