I'm interested in the TikZ pipeline, i.e. the sequence of low-level actions that a TikZ path is converted to as it is being "executed". Unfortunately, this is described only fragmentarily in the TikZ & PGF manual (for version 3.0.1a), so there is no escape from rolling up the metaphoric sleeves and diving into the source code. According to this comment by Mark Wibrow, the pipeline is implemented by the \tikz@finish macro in <tex installation directory>/tex/generic/pgf/frontendlayer/tikz/tikz.code.tex.
The \tikz@finish macro has the following structure:
% Step 1: The path background box
...
% Step 2: Decorate path
...
% Step 3: Preactions
...
...
% Step 13: Add labels and nodes
...
As can be seen, the pre-actions are applied before any node is inserted. However, the manual states in the description of the node option /tikz/behind path on p. 215:
When this key is set, [...] TikZ collects all nodes defined on the current path with this option set and then inserts all of them, in the order they appear, just before it draws the path. [...] "Just before it draws the path” actually means that the nodes are inserted into the page output just before any pre-actions are applied to the path
There seems to be a discrepancy between the manual and the source code. Is this a bug in the manual, or am I missing something?

/tikz/behind pathsets the\tikz@figbox@bgwhich is used in step 1. There is no discrepancy. – cfr Aug 03 '17 at 21:41\tikz@figbox@bgmacro the alias\tikz@whichbox: the only place in the file that the string 'behind path' appears is line 901:behind path/.code=\def\tikz@whichbox{\tikz@figbox@bg}. – Evan Aad Aug 03 '17 at 22:01\tikz@whichboxends up in\tikz@figbox@bgas opposed to the default\tikz@figbox. You can see from the order that makes a crucial difference to where the stuff ends up. – cfr Aug 03 '17 at 22:05