OpenGL pipeline stages, when is the primitive assembly executed? The question is simple, I have this diagram from the Khronos page:

And this diagram from the Learn OpenGL page

In the first picture the Primitive assembly is executed for example after the Geometry shader, in the second the execution happens before.
For the latter picture I took the relevant bit from the tutorial:

The primitive assembly stage takes as input all the vertices (or vertex if GL_POINTS is chosen) from the vertex shader that form a primitive and assembles all the point(s) in the primitive shape given; in this case a triangle.
The output of the primitive assembly stage is passed to the geometry shader. The geometry shader takes as input a collection of vertices that form a primitive and has the ability to generate other shapes by emitting new vertices to form new (or other) primitive(s). In this example case, it generates a second triangle out of the given shape.

I'm a bit confused cause I can't figure what that module and the Geometry shader takes as input, I'd be more prone to say the first diagram is correct. But maybe there's an interpretation I'm missing here.
When is the Primitive assembly executed then?
For a diagram to be comprehensive, it'd have to show way too much detail. It's just a simple tool.
Primitive assembly is the process of taking a sequence of vertices for a particular rendering primitive type, and generating a sequence of base primitives (points, lines, triangles) from them.
This process does indeed happen after vertex post-processing, as the input to the rasterizer is a sequence of base primitives. After all, you don't rasterize a triangle strip; you rasterize a triangle.
However, the input to a geometry shader invocation is a single base primitive, taken from the sequence of vertices provided up to that point. As such, a form of primitive assembly also must happen before the GS, to convert the vertex sequence into a sequence of base primitives.
This is also one reason why GS's are slow. If there is no GS, then this primitive assembly doesn't happen.
The output of the geometry shader is a bunch of vertex sequences, which still later undergo primitive assembly based on the output primitive type of the GS. A GS can output triangle strips, so there has to be primitive assembly to turn those strips into individual triangles.