MYSTERY: How to get access to the upstream algorithm from the client side?

Hello dear Paraview developers!

I have a question of great importance. How can one get access to the algorithm upstream to the current algorithm from the widget side?

I know about

filter = vtkSrcPrxyPtr::Take(vtkSMSourceProxy::SafeDownCast(proxyManager->NewProxy("filters", "ClientServerMoveData"))

instrument to get data output of the current algorithm on the client side. However, I can’t figure out how to get access to output of the upstream algorithms. All the proxies are SOURCE proxies, and seem not to have any input ports or so.

I can imagine accessing the necessary proxies from the Active Objects, but how to then figure out which algorithm is upstream to the current? I can make 1-10 algos and then attach 11th to the 5th for example, and if I use indices to get the previous for 11th, I would then get 10th and not 5th, which is indeed desirable?

Thank You great a lot!

How can one get access to the algorithm upstream to the current algorithm from the widget side?

At pq level:

pqPipelineFilter::getInput

At SM level:

vtkSMProxy::GetProducerProxy