Task query implementation