The notion of holonomy $R$-matrices is introduced. It is shown how to define invariants of tangles with flat connections in a principle $G$-bundle of the complement of a tangle using holonomy $R$-matrices.