Hi Pedro,
I'm not entirely sure about the app domain but I believe all OS code is executed under the same app domain.
Your use case is pretty common. You can create two actions, one that returns an object type and another one that accepts an object as input:
1. Set the output parameter data type as object

2. Set the input parameter data type as object

Then your extension implements the logic to handle those objects.