using (RapidWorkflowDataContext context = new RapidWorkflowDataContext()) { var query = from w in context.WorkflowInstanc
You can eliminate join and it should be something like:
join
var query = from w in context.WorkflowInstances where !context.Workflows.Any(c => w.CurrentStateID != c.LastStateID) && EmpWorkflowIDs.Contains((int)w.ID) select w;