Can you assign the SessionId to a target field in a DTL. There is a %Ensemble("SessionId") variable that looks like it would be available to use.
Ensemble supports Data Transformation Language (DTL) for describing data transformations. DTL is an XML language. Ensemble provides wizards and graphical tools for creating, editing, and testing DTL transformations. A data transformation is a Caché class like the following. If you prefer you can use Studio to edit the class definition directly and bypass the wizards and graphical tools.