How to Determine Data Transfer Flow Between Agents in Sequential or Hierarchical Processes?

I am working on a process that can either be sequential or hierarchical. I need to understand how to track the flow of data between agents. Specifically:

  1. How do I determine which agent transfers the result to another agent?
  2. How do I identify what data keys are being transferred between agents?

Are there any best practices, tools, or methods to capture this information efficiently?