Abstract: In order to design a decision-making framework in production environments, in this study, we use both the stochastic dynamic programming and Bayesian inference concepts. Using the posterior probability of the production process to be in state λ (the hazard rate of defective products), first we formulate the problem into a stochastic dynamic programming model. Next, we derive some properties for the optimal value of the objective function. Then, we propose a solution algorithm. At the end, the applications and the performances of the proposed methodology are demonstrated by two numerical examples.