In perturbative quantum field theory, one starts with interaction Lagrangian density
$$\mathcal{L} = \mathcal{L}_{\text{free}}+g\mathcal{L}_{\text{I}}\tag{1}$$
Where $g$ is coupling strength. Generating functional of the theory with background field $J$ is then given as
$$Z[J] = \int \mathcal{D}\phi \; e^{i \int d^kx \, (\mathcal{L}_{\text{free}}+g\mathcal{L}_{\text{I}})+\int d^kx J\phi}.\tag{2}$$
Taylor expanding the interaction amplitude in coupling constant $g$
$$e^{i g\int d^4x \mathcal{L}_{\text{I}}} = \sum^{\infty}_{n= 0}\frac{(ig)^n}{n!}\biggr(\int \mathcal{L}_{\text{I}}d^ky\biggr)^n = \sum^{\infty}_{n = 0}\frac{(ig)^n}{n!}\biggr(\int \mathcal{L}_{\text{I}}(y_1)\cdots \mathcal{L}_{\text{I}}(y_n)d^4y_1\cdots d^4y_n\biggr).\tag{3}$$
Then one obtains
$$\begin{align}Z[J] &= \int \mathcal{D}\phi \; e^{i \int d^kx \, \mathcal{L}_{\text{free}}+\int d^ky J\phi}\biggr(1+ig\int \mathcal{L}_{\text{I}}(y)d^ky_1+\mathcal{O}(g^2)\biggr)\tag{4}\\ &= \underbrace{\int \mathcal{D}\phi \; e^{i \int d^kx \, \mathcal{L}_{\text{free}}+\int d^ky J\phi}}_{ = Z_0[J]} + ig \int d^k y\int \mathcal{D}\phi \biggr(\mathcal{L}_{\text{I}}(y)\biggr)\; e^{i \int d^kx \, \mathcal{L}_{\text{free}}+\int d^kx J\phi} + O(g^2)\tag{5}\end{align}$$
Functional derivative of which leads us to
$$\begin{align}\frac{1}{Z[0]}\frac{\delta^n Z[J]}{\delta J(x_1)\cdots\delta J(x_n)}\biggr\vert_{J = 0} &= \langle \mathcal{T}\{\phi(x_1)\cdots \phi(x_n)\}\rangle_{\text{free}}-g\int d^ky \langle \mathcal{T}\{\phi(x_1)\cdots \phi(x_n)\mathcal{L}_{\text{I}}(y)\}\rangle_{\text{free}}+\mathcal{O}(g^2)\end{align}\tag{6}$$
Is this how we perturbatively compute the correlation functions of the interacting theory?