fixed max_depth condition and status reporting, record parent_node in nodes table and job started/completed in jobs table