> For the complete documentation index, see [llms.txt](https://learn.mechanic.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learn.mechanic.dev/platform/graphql/bulk-operations.md).

# Bulk operations

Fetching or writing large amounts of Shopify data can exhaust normal API limits, slow down other tasks, and consume too much task time or memory.

To solve this general problem, Shopify offers the bulk operations GraphQL API. Bulk operations let you submit work to Shopify for asynchronous processing, and Shopify stores the results in a JSONL file.

{% hint style="info" %}
For a review of how Mechanic uses bulk operations, start here: [Shopify / Bulk operations](/core/shopify/bulk-operations.md).
{% endhint %}

Mechanic supports both Shopify bulk operation types:

* `bulkOperationRunQuery`, for fetching large data sets.
* `bulkOperationRunMutation`, for running the same mutation once per JSONL variables line.

Both operation types are delivered back to the originating task using `mechanic/shopify/bulk_operation`. Use `bulkOperation.type` to distinguish `QUERY` from `MUTATION`.

For mutation results, remember that a completed operation means Shopify finished processing the file. It does not mean every line succeeded. Each JSONL result line should be checked for GraphQL errors and mutation `userErrors`.

## Great resources for learning Shopify GraphQL bulk operations

### Key concepts

* `bulkOperationRunQuery`
* `bulkOperationRunMutation`
* Staged JSONL uploads for bulk mutations
* Polling your operation's status (don't worry, Mechanic takes care of this for you)
* Data retrieval and JSONL
* Rate limits
* Operation restrictions

{% hint style="success" %}
[Shopify: bulkOperationRunQuery](https://shopify.dev/docs/api/admin-graphql/latest/mutations/bulkOperationRunQuery)
{% endhint %}

{% hint style="success" %}
[Shopify: bulkOperationRunMutation](https://shopify.dev/docs/api/admin-graphql/latest/mutations/bulkOperationRunMutation)
{% endhint %}

{% hint style="success" %}
[Mechanic tutorial: Running bulk operation mutations](/resources/tutorials/bulk-operation-mutations.md)
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://learn.mechanic.dev/platform/graphql/bulk-operations.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
