I am currently reading through the chapter about the spinor helicity formalism in Schwartz Quantum Field Theory and Standart Model. In the chapter 27.6 (On-shell recursion) the author introduces the BCFW-formula
$$M(1...n) = \sum_{a,b,h} M(1,...,a-1,b+1,...,n \rightarrow \hat{P}^h) \frac{1}{(p_a + ... + p_b)^2}M(\hat{P}^-h \rightarrow a,...,b), \tag{27.117}$$
which allows us to build up a tree level $n$-gluon scattering amplitude $M(1...n)$ recursively.
My problem is that I don´t understand, what the initial amplitude $M(1...n)$ really is. For example it is never mentioned, which/how many gluons are incoming/outgoing. This confuses me, due to the fact that it looks like that the recursion formula doesn´t differentiate between two $n$-gluon diagrams with different amounts of incoming and outgoing gluons.
Edit: I try to give an example so that it is easier to understand my problem. Lets suppose we are dealing with an $n = 5$ gluon amplitude. If I take a look at the recursion formula from above I don´t see the difference between e.g. the amplitude $M(p_1 + p_2 \rightarrow p_3 + p_4 + p_5)$ and $M(p_1 + p_2 + p_3 \rightarrow p_4 + p_5)$.