Properly handle and record step failures in your workflows
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 }); }