In this post, it is said that a functor from the fundamental groupoid of a space $X$ (denoted by $\Pi(X)$) to the category $\mathrm{Vect}$ of vector spaces gives a flat vector bundle over $X$. But I feel this picture might be generalized. For example,
(1) Let $X$ be a smooth manifold, and assume there is a functor from $\Pi(X)$ to a Lie group $G$ (as a Lie groupoid with one object). Under certain assumptions, does this give us a principle $G$-bundle? Or, even more generally, what if we replace $G$ by any arbitrary fiber manifold $F$?
(2) Let $X$ be a scheme, and assume a functor from $\Pi(X)$ to the category of schemes, say $x\mapsto Y_x$. Then, under certain nice conditions, what can we say about the union $Y:=\cup_{x\in X} Y_x$ and the natural map $Y\to X$? For example, is $Y$ still a scheme(probably no)?