In view of the interesting applications of alternating Euler trails, it is natural to ask about the existence of Euler trails fulfilling some restriction other than alternating. Let H be a graph possibly with loops and G a multigraph without loops. G is said to be H-colored if there exists a function $$c:E(G) \rightarrow V(H)$$ c : E ( G ) → V ( H ) . A trail $$W = (v_0, e_0, v_1, e_1, \ldots , e_{k-1}, v_k)$$ W = ( v 0 , e 0 , v 1 , e 1 , … , e k - 1 , v k ) in G is an H-trail if and only if $$(c(e_0), a_0, c(e_1), \ldots , c(e_{k-2}), a_{k-2}, c(e_{k-1}))$$ ( c ( e 0 ) , a 0 , c ( e 1 ) , … , c ( e k - 2 ) , a k - 2 , c ( e k - 1 ) ) is a walk in H with $$a_i=c(e_{i})c(e_{i+1})$$ a i = c ( e i ) c ( e i + 1 ) for every i in $$\{0, \ldots , k-2\}$$ { 0 , … , k - 2 } . In particular an H-trail is a properly colored trail when H is a complete graph without loops. An H-trail $$T = (v_0, e_0, v_1, e_1, \ldots , e_{k-1}, v_k)$$ T = ( v 0 , e 0 , v 1 , e 1 , … , e k - 1 , v k ) is a closedH-trail if $$v_0=v_k$$ v 0 = v k , and $$c(e_{k-1}$$ c ( e k - 1 ) and $$c(e_0)$$ c ( e 0 ) are adjacent in H. A closed H-trail, T, is a closed EulerH-trail if $$E(T)=E(G)$$ E ( T ) = E ( G ) . In order to see that H-coloring theory is related to the automata theory, let each vertex represents a state and each edge of H represents an allowed transition. This implies that an H-walk in a multigraph G is a predetermined sequence of allowed operations. Another interesting application goes as follows: a safe route conducted by a health inspector in a hospital (a route where the inspector does not carry bacteria from one area to another, in which can be deadly the spread such a bacteria) is given whenever the multigraph associated with the map of the hospital be an eulerian graph and it has a closed Euler H-trail for some well chosen H. Because of applications of Euler H-trails, it is natural to ask the following: (i) What structural properties of H imply the existence of Euler H-trails? (ii) What structural properties of G, with respect to the H-coloring, imply the existence of Euler H-trails? In this paper, we study Euler H-trails and we will show a characterization of the graphs containing an Euler H-trail. As a consequence of the main result we obtain a classical result proved by Kotzig (Matematickì časopis 18(1):76–80, 1968).