Skip to main content
object

An asynchronous operation that exports large datasets or imports data in bulk. Create bulk operations using bulkOperationRunQuery to export data or bulkOperationRunMutation to import data.

After creation, check the status field to track progress. When completed, the url field contains a link to download results in JSONL format. The objectCount field shows the running total of processed objects, while rootObjectCount tracks only root-level objects in nested queries.

If an operation fails but retrieves partial data, then the partialDataUrl field provides access to incomplete results.


Note

url and partialDataUrl values expire after seven days.


Learn more about exporting and importing data in bulk.

DateTime

When the bulk operation was successfully completed.

DateTime!
non-null

When the bulk operation was created.

BulkOperationErrorCode

Error code for failed operations.

UnsignedInt64

File size in bytes of the file in the url field.

ID!
non-null

A globally-unique ID.

UnsignedInt64!
non-null

A running count of all the objects processed. For example, when fetching all the products and their variants, this field counts both products and variants. This field can be used to track operation progress.

URL

The URL that points to the partial or incomplete response data (in JSONL format) that was returned by a failed operation. The URL expires 7 days after the operation fails. Returns null when there's no data available.

String!
non-null

GraphQL query document specified in bulkOperationRunQuery.

UnsignedInt64!
non-null

A running count of all the objects that are processed at the root of the query. For example, when fetching all the products and their variants, this field only counts products. This field can be used to track operation progress.

BulkOperationStatus!
non-null

Status of the bulk operation.

BulkOperationType!
non-null

The bulk operation's type.

URL

The URL that points to the response data in JSONL format. The URL expires 7 days after the operation completes.


Was this section helpful?

query

Returns a BulkOperation resource by ID.

Arguments

ID!
required

The ID of the BulkOperation to return.


query

Returns the app's bulk operations meeting the specified filters. Defaults to sorting by created_at, with newest operations first.

Arguments

Int

The first n elements from the paginated list.

String

The elements that come after the specified cursor.

Int

The last n elements from the paginated list.

String

The elements that come before the specified cursor.

Boolean
Default:false

Reverse the order of the underlying list.

BulkOperationsSortKeys
Default:CREATED_AT

Sort the underlying list using a key. If your query is slow or returns an error, then try specifying a sort key that matches the field used in the search.

String

A filter made up of terms, connectives, modifiers, and comparators. You can apply one or more filters to a query. Learn more about Shopify API search syntax.

Anchor to created_at
time

Filter operations created after a specific date.

id

Filter by id range.

Example:

  • id:1234
  • id:>=1234
  • id:<=1234
Anchor to operation_type
string

Filter operations by type.

Valid values:

  • query
  • mutation
string

Filter operations by status.

Valid values:

  • canceled
  • canceling
  • completed
  • created
  • failed
  • running

query
Deprecated

Arguments

BulkOperationType
Default:QUERY

The current bulk operation's type.



Was this section helpful?

mutation

Starts the cancelation process of a running bulk operation.

There may be a short delay from when a cancelation starts until the operation is actually canceled.

Arguments

ID!
required

The ID of the bulk operation to cancel.


mutation

Creates and runs a bulk operation to import data asynchronously. This mutation executes a specified GraphQL mutation multiple times using input data from a JSONL file that you've uploaded to Shopify.

The operation processes each line in your JSONL file as a separate mutation execution. The operation delivers results in a JSONL file when it completes. You can run one bulk mutation operation at a time per shop, though a bulkOperationRunQuery operation can run simultaneously.

Learn more about bulk importing data.

Arguments

String!
required

The mutation to be executed in bulk.

String!
required

The staged upload path of the file containing mutation variables.

Boolean
DeprecatedDefault:true
String

An optional identifier which may be used for querying.


mutation

Creates and runs a bulk operation to fetch data asynchronously. The operation processes your GraphQL query in the background and returns results in a JSONL 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.

Arguments

String!
required

The query to be executed in bulk.

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.



Was this section helpful?

interface

Was this section helpful?