Are you using node-red-contrib-boolean-logic? If so then the node should remember the states of other inputs (as identified by the topics). If you think this isn't working then export the non-working flow and post it here, along with instructions on how to trigger the fault, so we can try it. See this post on how to post a flow here.