It should be possible with a combination of Delay java action and Task queue (or any other module capable of processing in background). Also, the solution would depend on your exact requirement.
I’d suggest that when you create a message and save it, add 5 seconds (or the duration you want it to display)
addSeconds(currentDateTime, 5) and set this value in something called expired after.
Show the message only if the ExpiredAfter > CurrentDateTime.
Hope this helps!
I don’t understand your case exactly, but maybe the microflowtimer widget can help you out here.
One approach could be to use a Microflow Timer.
Put it in a container with visibility based on the boolean value, and add a microflow or nanoflow that will change the boolean value and handle any related logic.