Many scientific experiments produce an enormous amount of data that needs to be explored. Scientific workflows and tools for managing workflows have been designed to streamline the computational processes that manipulate this data, from acquisition to analysis. However, the fact that each system has its own workflow format has greatly hampered efficient sharing and re-use. To address this problem, we propose a general model for workflows, based on OPM, which combines features from popular scientific workflow systems. We use this model to build infrastructure that supports system-agnostic workflow repositories. We describe the implementation of the infrastructure and present an experimental evaluation of its performance. We show that the proposed model and its implementation provide efficient support for queries over large repositories.