Batch completion modes

When you set callbackUrl, the platform POSTs once per process when it reaches a terminal state.

Planned mode (expectedDocumentCount)

Set expectedDocumentCount to the total number of rows you will submit across all chunk POSTs for the same processBatchId (for example 1500 for three batches of 500). The value is fixed after the first non-null submit; repeat the same number or omit the field on follow-up POSTs.

  • The process stays open while accepted rows are below the planned total, even if no render jobs are in flight (so you can submit the next chunk without racing the callback).
  • The callback fires when all accepted rows are rendered and the count is met. Payload includes completionReason: expected_reached.
  • If you stop submitting before reaching the planned total, the idle grace (below) eventually closes the process as completed_with_errors with completionReason: idle_timeout.

Open-ended mode (omit expectedDocumentCount)

When you omit the field, the process closes after rendering goes idle for the platform grace period (default 15 minutes, configurable in super admin). Each new accepted chunk resets the timer. The callback payload includes completionReason: idle_timeout.

Callback payload (additional fields)

json
{
  "type": "integration_render_process.completed",
  "processBatchId": "...",
  "status": "completed",
  "completionReason": "expected_reached",
  "expectedDocumentCount": 1500,
  "batches": { "total": 3, "completed": 3, "failed": 0 },
  "documents": { "total": 1500, "rendered": 1498, "failed": 2 }
}

Poll list/download endpoints until outputs exist; treat the callback as a convenience signal, not the only source of truth.

Worker job

Operations should schedule the integration-process-completion worker job on a short interval (alongside integration-callback-relay) so idle grace deadlines are enforced.