Please see:

http://practical-crm.blogspot.com/2014/01/workflow-fetchxml-query.html