adding id encoding for graph flow