Automatic run query

Hi,
Is there any method or tricks that I can run again the query each time after the new data is insert into graph through kafka (realtime)?
Thank you!