CSPACE-5943: Incorporate check for deleted workflow state in sample SQL query.