Repository navigation
Update batch-jobs.mdx - #919
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
- Updated serverless/batch-jobs.mdx Mintlify-Source: dashboard-editor
- Updated serverless/batch-jobs.mdx Mintlify-Source: dashboard-editor
- Updated serverless/batch-jobs.mdx Mintlify-Source: dashboard-editor
- Updated serverless/batch-jobs.mdx Mintlify-Source: dashboard-editor
- Updated serverless/batch-jobs.mdx Mintlify-Source: dashboard-editor
- Updated serverless/batch-jobs.mdx Mintlify-Source: dashboard-editor
| - **FAILED** — The batch itself failed before or during execution (distinct from individual request failures in a batch whose other requests finished successfully). | ||
| - **CANCELLED** — You cancelled the batch. See [Cancellation](#cancellation) for details. | ||
| - **DRAFT**: The batch is a draft, and you can still change its requests. Batch workers haven't started any work. | ||
| - **FINALIZED**: The batch is locked, and you can't add or remove requests. Batch workers process the requests while the batch stays in this state, and the API has no separate `RUNNING` or `COMPLETED` batch status. Track progress with the `requestTotal`, `requestInProgress`, `requestCompleted`, and `requestFailed` counts. All requests have finished when `requestCompleted + requestFailed` equals `requestTotal`. |
There was a problem hiding this comment.
We'll need one more state for COMPLETED here
There was a problem hiding this comment.
@Promptless update the "Batch lifecycle" section to add a COMPLETED API state
- Change the diagram to:
DRAFT → FINALIZED → COMPLETED
→ FAILED
→ CANCELLED - In the FINALIZED bullet, remove "and the API has no separate
RUNNINGorCOMPLETEDbatch status". Keep the sentence about tracking progress with requestTotal, requestInProgress, requestCompleted, and requestFailed. - Add a bullet after FINALIZED: "COMPLETED: All requests in the batch have finished. Some individual requests may have failed, so check
requestFailed." - Keep the existing style: colon after the bold state name, sentence ends with a period, no em dashes.
| ``` | ||
|
|
||
| Poll this endpoint at whatever interval suits your workflow. A batch that is still processing reports `status: FINALIZED`; there is no `RUNNING` or `COMPLETED` status. All requests have finished when `requestCompleted + requestFailed` equals `requestTotal`. The batch reaches a terminal state only when `status` is `FAILED` or `CANCELLED`. The `createdAt` field is a Unix epoch timestamp in milliseconds. | ||
| This batch is still processing: 244 of 1,000 requests are complete and 6 have failed. A batch reports `FINALIZED` while it runs. All of its requests have finished when `requestCompleted + requestFailed` equals `requestTotal`. The status only changes again if the batch fails (`FAILED`) or you cancel it (`CANCELLED`). The `createdAt` field is a Unix timestamp in milliseconds. |
There was a problem hiding this comment.
@Promptless Replace:
"A batch reports FINALIZED while it runs. All of its requests have finished when requestCompleted + requestFailed equals requestTotal. The status only changes again if the batch fails (FAILED) or you cancel it (CANCELLED)."
With:
"A batch reports FINALIZED while its requests are processing. When all requests have finished (requestCompleted + requestFailed equals requestTotal), the status changes to COMPLETED. To check whether a batch is done, use the status field. If the batch itself fails, the status is FAILED, and if you cancel it, the status is CANCELLED."
There was a problem hiding this comment.
Got it, I'll replace that paragraph with your wording so the batch status description includes COMPLETED. I'll reply here once the suggestion is updated.
There was a problem hiding this comment.
Done. This paragraph uses your wording exactly. To match it, I made two other changes on the page:
- The
FINALIZEDbullet in the lifecycle section says the batch moves toCOMPLETEDwhen every request has finished. - In the console status table, Completed maps to
COMPLETEDand Running maps toFINALIZED. This also covers jhcipar's comment on line 222.
One question: the Notifications section says notifications are sent when a batch reaches a terminal state (FAILED or CANCELLED). Should COMPLETED be on that list too? I didn't change it because I couldn't confirm whether completed batches send a notification.
Review: https://app.gopromptless.ai/suggestions/d6b7a0be-7394-4edd-bee7-17372ae67c70
| | --- | --- | | ||
| | **Draft** | `DRAFT` | | ||
| | **Running** | `FINALIZED` (requests still processing) | | ||
| | **Completed** | `FINALIZED` (all requests finished) | |
There was a problem hiding this comment.
I'll apply the same change to the completed status on this line, matching the earlier review comment. I'll reply here once the suggestion is updated.
There was a problem hiding this comment.
This change is already on the branch, so I didn't push anything new. In the console statuses table, the Completed row shows COMPLETED and the Running row shows FINALIZED. Both rows were updated in commit 4b93216, which was made for the earlier comment on line 44.
|
Thanks @lavanya-gunreddi. I'm updating the "Batch lifecycle" section to add the |
|
@lavanya-gunreddi I made the three edits you asked for in the "Batch lifecycle" section and pushed them to this branch in commit 53aafb9. The diagram includes I didn't change anything outside that section, but three other passages on the page still say a batch stays
Triggered by: #919 (review) |
|
|
||
| ## Notifications | ||
|
|
||
| When a batch reaches a terminal state (`FAILED` or `CANCELLED`), Runpod sends: |
There was a problem hiding this comment.
we also send notifications for completed
|
@Promptless replace every "batch_01j9abc123" on the page with "5af6bdb3-551f-4195-8872-bad522efbad7". Real batch IDs are UUIDs. This includes the Step 1 create response and the Step 4 batch summary response. |
|
@Promptless in the Step 5 response example, replace the startedAt and completedAt fields with delayTime and executionTime. After the example, add: "Each request includes |
|
In reply to this discussion Got it: every |
|
@Promptless in the Error handling section, after the paragraph that explains the request failure limit, add: "A failed batch includes a {
"id": "5210fe3f-ee61-4a81-bc4e-7078c955c24d",
"endpointId": "bo3oj8kx6jz411",
"status": "FAILED",
"requestTotal": 12,
"requestInProgress": 0,
"requestCompleted": 0,
"requestFailed": 10,
"failureCode": "REQUEST_FAILURE_LIMIT",
"failedAt": 1793132360580,
"createdAt": 1793132294147,
"name": "intentional-failed-batch-example"
}In this example, 10 of 12 requests failed, which reached the limit, so the batch stopped and the remaining 2 requests didn't run.
The |
|
In reply to this discussion Got it: the Step 5 response example will use |
|
@Promptless in the Error handling section, after the first paragraph, add: "If your handler returns an error in its output instead of raising an exception, Runpod marks the request |
|
In reply to this discussion Got it: your failed-batch explanation, example response, and |
|
@Promptless in the Cancellation section, after "The batch status changes to "If you cancel a batch before any requests start, it moves to |
|
In reply to this discussion Got it: your note about handler errors returned in |
|
In reply to this discussion Got it: your sentence about cancelling a batch before any requests start will go after the |
… failure codes, cancellation billing
|
In reply to this discussion Both example batch IDs are now Triggered by: #919 (comment) |
|
In reply to this discussion The Step 5 response example uses Triggered by: #919 (comment) |
|
In reply to this discussion Your failed-batch explanation, example response, Two existing sentences contradicted your content, so I changed them:
The page also doesn't state the request failure limit. The example only shows 10 of 12 requests failing. You may want to add the threshold, for example in the Limits table. Triggered by: #919 (comment) |
|
In reply to this discussion Your paragraph about handler errors returned in Triggered by: #919 (comment) |
|
In reply to this discussion Your sentence about cancelling a batch before any requests start is in the Cancellation section as written. It follows the sentence about the Triggered by: #919 (comment) |
|
@Promptless Review serverless/batch-jobs.mdx against the rules in PROMPTLESS.md and the Runpod documentation style guide (.claude/style-guide.md), and fix anything that doesn't follow them. Don't change the technical content. |
|
In reply to this discussion Got it: I am reviewing |
|
In reply to this discussion I pushed a style-only pass on
Your latest edits, the I left two things alone because changing them would change content. The billing note near the top repeats the Billing section, and numerals such as "6 have failed" stay as written. Vale reports no errors on the page. I didn't run a Mintlify build. Suggestion: https://app.gopromptless.ai/suggestions/d6b7a0be-7394-4edd-bee7-17372ae67c70 |
Adds the
COMPLETEDAPI state toserverless/batch-jobs.mdxand makes the batch status description consistent across the page, as requested in review on this PR.DRAFT → FINALIZED → COMPLETED / FAILED / CANCELLED, and added aCOMPLETEDbullet noting that individual requests may still have failed.FINALIZEDbullet to say the batch moves toCOMPLETEDoncerequestCompleted + requestFailedequalsrequestTotal.FINALIZEDwhile requests process,COMPLETEDwhen all have finished, andFAILEDorCANCELLEDotherwise.COMPLETEDAPI status, and the console Running status toFINALIZED.Follow-up review edits:
startedAtandcompletedAtin the Step 5 response example withdelayTimeandexecutionTime, and explained both fields (in milliseconds).failureCodeandfailedAtfields, an exampleREQUEST_FAILURE_LIMITresponse, and a table offailureCodevalues. Qualified the opening paragraph so it reflects that a batch stops once failures reach the request failure limit, and replaced the claim that aFAILEDbatch always means a systemic problem.COMPLETED, don't count toward the failure limit, and need theiroutputchecked.CANCELLEDimmediately and isn't billed.Style pass (requested in review): brought
serverless/batch-jobs.mdxin line withPROMPTLESS.mdand.claude/style-guide.md(including the Runpod and Google rules it references) without changing technical content./run" and "Monitoring batches in the console" to "Monitor batches in the console".GET .../requestswith the fullGET /v2/ENDPOINT_ID/batch/BATCH_ID/requestspath.CardGroupof horizontal cards.Validation: Vale (repo config, plus Promptless and Knowledge Base rules) reports 0 errors on the page; the only new findings are Readability suggestions.
Review feedback
Applied verbatim: the reviewer's replacement paragraph after the batch status example (line 134).
Applied for consistency with that change and the earlier COMPLETED comments: the
FINALIZEDbullet and the console status table.Applied verbatim: UUID batch ID in the Step 1 and Step 4 responses; the
delayTime/executionTimesentence after the Step 5 example; the failed-batch example,failureCodetable, andfailedAtnote; the handler-returned-error paragraph after the first Error handling paragraph; and the cancel-before-start sentence in Cancellation.Changed for consistency: Step 5 example values for
delayTimeandexecutionTimewere chosen as plausible millisecond values. In Error handling, the opening paragraph now says a failed request doesn't fail the batch "unless failures reach the request failure limit", and theFAILEDparagraph no longer says the problem is always systemic. Both previously contradicted the newREQUEST_FAILURE_LIMITcontent.Placement: the failed-batch block comes after the
FAILEDparagraph. The page had no separate paragraph explaining the request failure limit, so that was the closest anchor.Style pass: applied the reviewer's request to conform the page to
PROMPTLESS.mdand.claude/style-guide.mdwithout changing technical content. The reviewer's latest commit (theCOMPLETEDnotification state and the request failure limit table) is preserved. Left unchanged: the billing<Note>near the top, which repeats the Billing section; removing it is a content decision rather than a style rule.