How to invoke custom rendering pass from python

I need to automate rendering movies arranged in Sequencer. I found some very helpful examples at ./Engine/Plugins/MovieScene/SequencerScripting/Content/Python/sequencer_examples.py showing how to invoke the sequencer-related api customizing things like frame resolution.

But for my use case I need to enable custom rendering passes from python (to get velocity and depth map in addition to final image). And I can’t find any relevant API or example for doing that.

Enabling “render in separate process” results in file ./Saved/MovieSceneCapture/Manifest.json
After peeking at it modifying the provided example becomes almost trivial:

capture_settings.set_image_capture_protocol_type(unreal.load_class(None, “/Script/MovieSceneCapture.CompositionGraphCaptureProtocol”))

capture_settings.get_image_capture_protocol().include_render_passes
= unreal.CompositionGraphCapturePasses([“FinalImage”,
“Velocity”])