full query workflow