Implements serialization of a job graph with dependencies.