Bulk GraphQL Export Errors

Topic summary

Main issue: Bulk exports of orders via Shopify’s GraphQL Bulk API intermittently fail with status INTERNAL_SERVER_ERROR after running ~20 hours; occasionally the same approach returns COMPLETED, so reliability is the concern.

Context and attempt: The operation uses bulkOperationRunQuery to fetch orders filtered by created_at between 2021-09-01 and 2021-09-14 (and other ranges tried). The query requests order fields (pricing, timestamps, tags, channel/app, customer, email) and nested lineItems with variant and quantity.

Evidence: A specific BulkOperation GID was provided (gid://shopify/BulkOperation/421838356585). Polling the operation status yields mixed results (COMPLETED vs INTERNAL_SERVER_ERROR) across similar queries of varying size.

Clarifications: Bulk Operation is Shopify’s asynchronous GraphQL export mechanism; GID is a Global ID. Polling refers to repeatedly checking the operation’s status until completion.

Ask/outcome: The poster seeks a reliable method to export order data without intermittent failures. No resolution, guidance, or confirmed root cause yet; discussion remains open. The provided code snippet is central to understanding the issue.

Summarized with AI on March 1. AI used: gpt-5.

Hello,

We’ve been attempting to export orders for a store using the bulk GraphQL API. After running for ~20 hours we received an “INTERNAL_SERVER_ERROR” after polling for the status of the operation. We’ve tried similar queries of varying size (by filtering “created_at”) with mixed results. We occasionally receive a “COMPLETED” result but not consistently. We’d like a reliable way to export order data.

mutation {
              bulkOperationRunQuery(
              query: """
                {
                  orders(query: "created_at:>='2021-09-01' AND created_at:<'2021-09-14'") {
                    edges {
                      node {
                        id
                        totalPrice
                        subtotalPrice
                        tags
                        cancelledAt
                        createdAt
                        updatedAt
                        closedAt
                        confirmed
                        currencyCode
                        name
                        channel {
                          app {
                            id
                          }
                        }
                        lineItems {
                          edges {
                            node {
                              id
                              variant {
                                id
                              }
                              quantity
                            }
                          }
                        }
                        processedAt
                        customer {
                          id
                          firstName
                          lastName
                          phone
                        }
                        email
                      }
                    }
                  }
                }
              """)
            {
              bulkOperation {
                id
                status
              }
            
              userErrors {
                field
                message
              }
            }
          }

Also, here’s a GID for reference: gid://shopify/BulkOperation/421838356585