What activities with loop or flow decision …??
The most straightforward solution is to use the Element Exists activity that returns a boolean (True or False) value. It tries to look for a particular selector for the duration of the set timeout.
It returns True as soon as it finds an element or False if it couldn’t find it within the time set.
Afterwards you can use this variable in a Flow Decision activity or an IF statement.