--- title: bulkOperationRunQuery - GraphQL Admin description: >- Creates and runs a [bulk operation](https://shopify.dev/docs/api/admin-graphql/latest/objects/BulkOperation) to fetch data asynchronously. The operation processes your GraphQL query in the background and returns results in a [JSONL](http://jsonlines.org/) file when complete. Apps can run one bulk query operation and one bulk mutation operation at a time per shop. The query must include at least one connection field and supports up to five connections with a maximum nesting depth of two levels. > Note: Results remain available for seven days after completion. For more information, see the [bulk operations guide](https://shopify.dev/docs/api/usage/bulk-operations/queries). api_version: unstable api_name: admin source_url: html: >- https://shopify.dev/docs/api/admin-graphql/unstable/mutations/bulkOperationRunQuery md: >- https://shopify.dev/docs/api/admin-graphql/unstable/mutations/bulkOperationRunQuery.md --- # bulk​Operation​Run​Query mutation Creates and runs a [bulk operation](https://shopify.dev/docs/api/admin-graphql/latest/objects/BulkOperation) to fetch data asynchronously. The operation processes your GraphQL query in the background and returns results in a [JSONL](http://jsonlines.org/) file when complete. Apps can run one bulk query operation and one bulk mutation operation at a time per shop. The query must include at least one connection field and supports up to five connections with a maximum nesting depth of two levels. *** Note Results remain available for seven days after completion. *** For more information, see the [bulk operations guide](https://shopify.dev/docs/api/usage/bulk-operations/queries). ## Arguments * group​Objects [Boolean!](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/Boolean) requiredDefault:false Enables grouping objects directly under their corresponding parent objects in the JSONL output. Enabling grouping slows down bulk operations and increases the likelihood of timeouts. Only enable grouping if you depend on the grouped format. * query [String!](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/String) required The query to be executed in bulk. *** ## Bulk​Operation​Run​Query​Payload returns * bulk​Operation [Bulk​Operation](https://shopify.dev/docs/api/admin-graphql/unstable/objects/BulkOperation) The newly created bulk operation. * user​Errors [\[Bulk​Operation​User​Error!\]!](https://shopify.dev/docs/api/admin-graphql/unstable/objects/BulkOperationUserError) non-null The list of errors that occurred from executing the mutation. *** ## Examples * ### bulkOperationRunQuery reference ## Mutation Reference ```graphql mutation bulkOperationRunQuery($query: String!, $groupObjects: Boolean!) { bulkOperationRunQuery(query: $query, groupObjects: $groupObjects) { bulkOperation { # BulkOperation fields } userErrors { field message } } } ``` ## Input ##### Variables ```json { "query": "", "groupObjects": true } ```