Skip to content

Workflows ‐ Example GraphQL queries

rzlim08 edited this page Mar 8, 2024 · 3 revisions

Queries

Get a manifest for a workflow version

query GetManifest {
  workflowVersions(where: {id: {_eq: "" }}) {
    id
    manifest
  }
}

Count workflow versions for a given workflow

query CountWorkflowVersions {
  workflowVersionsAggregate(where: {workflow: {name: {_eq: "workflow_name"}}}) {
    aggregate {
      count(columns: id, distinct: true)
    }
  }
}

Get all execution ids in a project

query GetAllExecutionIds {
  workflowRuns(where: {collectionId: {_eq: 444}}) {
    executionId
  }
}

Get all Workflow Runs of a type for a given input entity

query GetWorkflowRunsofType {
  workflowRuns(
    where: {entityInputs: {id: {_eq: "xxxxxx"}, entityType: {_eq: "sequencing_read"}}, workflowVersion: {workflow: {name: {_eq: "consensus-genome"}}}}
  ) {
    executionId
    id
    outputsJson
    ownerUserId
    ...
  }
}

Get all entity inputs with sample type

query GetEntityInputsofTypeSample {
  workflowRunEntityInputs(where: {entityType: {_eq: "sample"}}) {
    entityType
    fieldName
    id
    inputEntityId
    producingRunId
  }
}