Adding the steps to retrieve documents which are only in the published step
var publishedSteps = WorkflowStepInfoProvider.GetWorkflowSteps()
.WhereEquals("StepID", CMS.DataEngine.WorkflowStepTypeEnum.DocumentPublished)
.Column("StepID");
query.WhereIn("DocumentWorkflowStepID", publishedSteps);