BulkOperation
Requires Only accessible by supported access tokens: https://shopify.dev/docs/api/usage/bulk-operations/queries#access-token-considerations.
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 field shows the running total of processed objects, while tracks only root-level objects in nested queries.
If an operation fails but retrieves partial data, then the field provides access to incomplete results.
url and values expire after seven days.
url and values expire after seven days.
Note: <code>url</code> and <code><span class="PreventFireFoxApplyingGapToWBR">partial<wbr/>Data<wbr/>Url</span></code> values expire after seven days.
Anchor to FieldsFields
- completedAt (DateTime)
- createdAt (DateTime!)
- errorCode (BulkOperationErrorCode)
- fileSize (UnsignedInt64)
- id (ID!)
- objectCount (UnsignedInt64!)
- partialDataUrl (URL)
- query (String!)
- rootObjectCount (UnsignedInt64!)
- status (BulkOperationStatus!)
- type (BulkOperationType!)
- url (URL)
- Anchor to completedAtcompleted•Date
At Time When the bulk operation was successfully completed.
- Anchor to createdAtcreated•Date
At Time! non-null When the bulk operation was created.
- Anchor to errorCodeerror•Bulk
Code Operation Error Code Error code for failed operations.
- Anchor to fileSizefile•Unsigned
Size Int64 File size in bytes of the file in the
urlfield.- •ID!non-null
A globally-unique ID.
- Anchor to objectCountobject•Unsigned
Count Int64! 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.
- Anchor to partialDataUrlpartial•URL
Data 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
nullwhen there's no data available.- Anchor to queryquery•String!non-null
GraphQL query document specified in
.- Anchor to rootObjectCountroot•Unsigned
Object Count Int64! 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.
- Anchor to statusstatus•Bulk
Operation Status! non-null Status of the bulk operation.
- Anchor to typetype•Bulk
Operation Type! non-null The bulk operation's type.
Anchor to QueriesQueries
- bulkOperation (BulkOperation)
- bulkOperations (BulkOperationConnection!)
- currentBulkOperation (BulkOperation): deprecated
- •query
Returns a
resource by ID.- •ID!required
The ID of the
to return.
Arguments
- •ID!
- •query
Returns the app's bulk operations meeting the specified filters. Defaults to sorting by created_at, with newest operations first.
- Anchor to firstfirst•Int
The first
nelements from the paginated list.- Anchor to afterafter•String
The elements that come after the specified cursor.
- Anchor to lastlast•Int
The last
nelements from the paginated list.- Anchor to beforebefore•String
The elements that come before the specified cursor.
- Anchor to reversereverse•BooleanDefault:false
Reverse the order of the underlying list.
- Anchor to sortKeysort•Bulk
Key Operations Sort Keys 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.
- Anchor to queryquery•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.
Arguments
- •queryDeprecated
- Anchor to typetype•Bulk
Operation Type Default:QUERY The current bulk operation's type.
Arguments
Anchor to MutationsMutations
- bulkOperationCancel (BulkOperationCancelPayload)
- bulkOperationRunMutation (BulkOperationRunMutationPayload)
- bulkOperationRunQuery (BulkOperationRunQueryPayload)
- •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.
- •ID!required
The ID of the bulk operation to cancel.
Arguments
- •ID!
- •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
operation can run simultaneously.Learn more about bulk importing data.
- Anchor to mutationmutation•String!required
The mutation to be executed in bulk.
- Anchor to stagedUploadPathstaged•String!
Upload Path required The staged upload path of the file containing mutation variables.
- Anchor to groupObjectsgroup•Boolean
Objects DeprecatedDefault:true - Anchor to clientIdentifierclient•String
Identifier An optional identifier which may be used for querying.
Arguments
- •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.
NoteResults remain available for seven days after completion.
Note:Results remain available for seven days after completion.
Note: Results remain available for seven days after completion.
For more information, see the bulk operations guide.
- Anchor to queryquery•String!required
The query to be executed in bulk.
- Anchor to groupObjectsgroup•Boolean!
Objects 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.
Arguments