8. In an isosceles right $\triangle ABC$, $\angle C=90^{\circ}$, point $P$ is inside the triangle, satisfying
$$
\overrightarrow{P A}+\sqrt{2} \overrightarrow{P B}+(2 \sqrt{2}+2) \overrightarrow{P C}=\mathbf{0} \text {. }
$$

Then $\angle A P B=$ $\qquad$
8. $\frac{5 \pi}{8}$.

As shown in Figure 4, extend $A P$, $B P$, and $C P$ to intersect the opposite sides at points $D$, $E$, and $F$ respectively.
From the given and $\overrightarrow{P A}=\overrightarrow{P F}+\overrightarrow{F A}$, $\overrightarrow{P B}=\overrightarrow{P F}+\overrightarrow{F B}$, we get $(\overrightarrow{F A}+\sqrt{2} \overrightarrow{P B})+((1+\sqrt{2}) \overrightarrow{P F}+(2 \sqrt{2}+2) \overrightarrow{P C})=\mathbf{0}$. According to the basic theorem of plane vectors, we have
$$
\overrightarrow{F A}+\sqrt{2} \overrightarrow{F B}=\mathbf{0},
$$

which implies $A F: F B=\sqrt{2}: 1$.
Similarly, $B D: D C=(2+\sqrt{2}): 1$,
$$
A E: E C=(2 \sqrt{2}+2): 1.
$$

From this, we get
$$
\begin{array}{l}
A E=A F \\
\Rightarrow \angle A F E=\frac{\pi-\angle C A B}{2}=\frac{3 \pi}{8}.
\end{array}
$$

Extend $C F$ to point $G$ such that $B G \parallel A C$. Then
$$
\frac{B G}{A C}=\frac{B F}{A F}=\frac{1}{\sqrt{2}}.
$$

Let $\angle E B C=\alpha$, $\angle G C B=\beta$. Then
$\tan \beta=\frac{1}{\sqrt{2}}$,
$\tan \alpha=\frac{C E}{C B}=\frac{C E}{A E+E C}=\frac{1}{3+2 \sqrt{2}}$.
Thus, $\tan (\alpha+\beta)=\frac{\tan \alpha+\tan \beta}{1-\tan \alpha \cdot \tan \beta}$
$=\frac{\frac{1}{3+2 \sqrt{2}}+\frac{1}{\sqrt{2}}}{1-\frac{1}{(3+2 \sqrt{2}) \sqrt{2}}}=\frac{3+3 \sqrt{2}}{3+3 \sqrt{2}}=1$
$\Rightarrow \angle B P F=\alpha+\beta=\frac{\pi}{4}$
$\Rightarrow A$, $E$, $P$, $F$ are concyclic
$\Rightarrow \angle A P B=\angle B F E=\frac{5 \pi}{8}$.