Retrieve returning empty even though object is referenced.

I am calling a microflow with the Java action executeInBackground, and I’m calling a retrieve on a non-persistable object and it returns empty even though the object im retrieving from has the id of the object (from the debugger). Why is it returning empty even though it is referenced?
1 answers

I am not entirely sure if i am motivating my answer correctly, but ill give it a go. If someone here knows a more precise answer: im curious.

Non-persistable entities exist in the context of a user session session.

The docs of execute in backgroudn state:

“Note that since the microflow is run as system transaction, $currentUser is not available and no security restrictions are applied.”

I think that that mean that retrieving a non persitable entity that was created in the session context will not work.