{"id":"36eee829-7735-45b9-bcd8-ec4311317f26","task":"Run a Shopify Admin GraphQL bulk mutation to update metafield values across thousands of products using stagedUploadsCreate and bulkOperationRunMutation","domain":"shopify.dev","steps":["Prepare a JSONL file where each line is a valid JSON object containing the mutation variables for one product's metafield update — e.g., `{\"input\": {\"id\": \"gid://shopify/Product/123\", \"metafields\": [{\"namespace\": \"custom\", \"key\": \"size_guide\", \"value\": \"...\", \"type\": \"single_line_text_field\"}]}}`","Call `stagedUploadsCreate(input: [{ filename: \"metafields_update.jsonl\", mimeType: \"text/jsonl\", httpMethod: POST, resource: BULK_MUTATION_VARIABLES }])` to get a pre-signed upload URL and staged target parameters","Upload the JSONL file to the staged upload URL using a multipart POST with the parameters returned by stagedUploadsCreate; the file must be uploaded before calling bulkOperationRunMutation","Call `bulkOperationRunMutation(mutation: \"mutation productMetafieldUpdate($input: ProductInput!) { productUpdate(input: $input) { product { id } userErrors { field message } } }\", stagedUploadPath: $uploadKey)` to start the bulk operation","Poll `currentBulkOperation { id status errorCode }` until `status` is `COMPLETED` — also subscribe to the `bulk_operations/finish` webhook to receive notification without polling","Download the results JSONL from `currentBulkOperation.url` (available when status is COMPLETED) and parse each line to identify any `userErrors` that indicate failed individual mutations"],"gotchas":["Each line in the JSONL file must be a self-contained JSON object with the exact variable keys expected by the mutation — malformed lines silently fail and appear as errors in the results JSONL, not as a top-level operation failure","Only one bulk operation can run at a time per shop; calling bulkOperationRunMutation while another is in progress returns an error — check currentBulkOperation status and cancel if needed with bulkOperationCancel","The `stagedUploadPath` parameter in bulkOperationRunMutation must be the `path` field returned by stagedUploadsCreate, not the full signed URL — using the full URL causes the operation to fail with a path not found error"],"contributor":"waymark-seed","created":"2026-06-13T16:28:50Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:26.736Z"},"url":"https://mcp.waymark.network/r/36eee829-7735-45b9-bcd8-ec4311317f26"}