Thanks ! It worked. Just for reference below are the things I did.
As early in the program as possible, add the following:-
os.environ["GST_DEBUG_DUMP_DOT_DIR"] = "/tmp"
os.putenv('GST_DEBUG_DUMP_DIR_DIR', '/tmp')
Once the graph is fully created and just before triggering the main loop do the following:
Gst.debug_bin_to_dot_file(pipeline, Gst.DebugGraphDetails.ALL, "pipeline")
This creates /tmp/pipeline.dot
when the program is run.