8. Let $x_{i} \in\{1,2, \cdots, n\}, i=1,2, \cdots, n$ satisfy $\sum_{i=1}^{n} x_{i}=\frac{n(n+1)}{2}, x_{1} x_{2} \cdots x_{n}=n$!. Then, the largest positive integer $n$ for which $x_{1}, x_{2}, \cdots, x_{n}$ must be a permutation of $1,2, \cdots, n$ is $\qquad$.
8. 8 .

When $n \geqslant 9$, the factors $8,6,3$ in $n!$ can be replaced by $9,4,4$, with $8+6+3=9+4+4$, $8 \times 6 \times 3=9 \times 4 \times 4$. Thus, the sum $x_{1}+x_{2}+\cdots+x_{n}$ and the product $x_{1} x_{2} \cdots x_{n}$ remain unchanged. When $n=8$, it is known that $x_{1}, x_{2}, \cdots, x_{8}$ is indeed a permutation of $1,2, \cdots, 8$.