BulkOperation FAILED with partialDataUrl: Best practices for retrying failed records?

Hello everyone,

I’m implementing error handling for bulk operations and have a question about retrying failed mutations.

When I receive a “bulk_operations/finish” webhook after running a bulk mutation, I query the result using query getBulkOperation and handle FAILED status for error handling.

From my research, I understand that partialDataUrl contains only successfully processed records. This means that to retry failed records, I need to:

  1. Compare the original input JSONL file (uploaded when starting the bulk operation)
  2. With the JSONL file from partialDataUrl (containing only successful records)
  3. Identify which records failed by finding the difference between the two files

Is this the correct approach, or are there more efficient methods for error handling and retrying failed bulk operations? I’d appreciate any advice on best practices for this scenario.

Thank you!

Hey @ayaMatsu_Rewire your general approach is workable for sure.

Best practice is usually to parse the JSONL result, and use the line number to map back to your original input. One thing to note is that if you’re seeing INTERNAL_FILE_SERVER_ERROR for the failure error status code, it’s usually safe to retry those and we would recommend building in a retry mechanism to your integration if you’re automating these.

Hope this helps - let me know if I can clarify anything or help out further.

1 Like

Thanks Alan_G! :folded_hands: I’ll try mapping the both JSONLs.

Sounds good @ayaMatsu_Rewire - please let me know if I can help out further at all! :slight_smile: