# Saving episode trajectories during training

**URL:** <https://discuss.ray.io/t/saving-episode-trajectories-during-training/11388>\
**Category:** RLlib\
**Created:** [July 13, 2023, 3:10pm UTC](https://discuss.ray.io/t/saving-episode-trajectories-during-training/11388 "2023-07-13T15:10:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mzat](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/mzat/32/4752_2.png) [@mzat](https://discuss.ray.io/u/mzat)\
**Post date:** [July 13, 2023, 3:10pm UTC](https://discuss.ray.io/t/saving-episode-trajectories-during-training/11388/1 "2023-07-13T15:10:18Z")

</div>

**How severe does this issue affect your experience of using Ray?**

- High: It blocks me to complete my task.

I would like to save for each episode the observation space and action space with timestep granularity.  
The way I’m trying to achieve this is using the `on_postprocess_trajectory` callback. There, I have both `postprocessed_batch` and `original_batches` that provide access to a `SampleBatch` object. In that object, I have what seems to be actions, but these actions are transformed.  
Is there an easy way to get the environment representation of the action?
