Answer
Check the platform's session-deferred-status function (part of the transaction system API) rather than trying to infer it indirectly from the calling user identity — combining that check with your existing user-based condition is a more reliable way to distinguish "this is a background job" from "this is IFSAPP acting interactively," which aren't actually the same thing.