Using custom node group with Python script for Compositor
This is done by adding a node group:

group = C.scene.node_tree.nodes.new('CompositorNodeGroup')


... and then adding the custom group as new group's node tree:

group.node_tree = bpy.data.node_groups['somegroupname']