---
id: WF-PFM-DJE-009
title: Run Platform data jobs inside the submitting request
trigger: >-
  A Platform submit, apply, resume or retry request invokes local processing,
  including an in-process migration dataset.
product_area: platform
module: data-job-engine
revision: 1
status: draft
design_intent: proposed
implementation_evidence: observed
inference: []
source_sha:
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
  macroservice-libraries: 54536a441935c6e09fdb7f96f0bec71c52ba4e03
implements:
  - CAP-PFM-DJE-018
  - CAP-PFM-DJE-001
  - CAP-PFM-DJE-016
moves:
  - STATE-PFM-DJE-001
  - STATE-PFM-DJE-002
crosses:
  - SVC-PFM-DJE-data-jobs
  - SVC-PFM-DJE-engine
hops:
  - 'n': 1
    actor_or_service: Platform data-job route
    action: >-
      Check the custom-field bulk and admitted write keys, or the custom-record
      create key with scoped checks.
    anchor: >-
      services-platform:modules/data-jobs/aws/api/custom-field-data-jobs.routes.ts:dataJobAuthorization
    seam: sync
    on_failure: Return forbidden access before submission.
    left_inconsistent: No job has been created.
    observer: The request response exposes the result.
    provenance: test
    source: >-
      services-platform:modules/data-jobs/tests/integration/services/jobs/custom-field-data-jobs.integration.spec.js#refuses
      a caller who may create a definition but holds no bulk right
  - 'n': 2
    actor_or_service: Platform submission
    action: >-
      Parse completed upload input, enforce the 500-line bound and create
      ordinary engine items.
    anchor: >-
      services-platform:modules/data-jobs/services/jobs/custom-field-data-jobs.ts:submitPlatformDataJob
    seam: sync
    on_failure: Refuse invalid or oversized input before job persistence.
    left_inconsistent: No partial dataset job remains.
    observer: The request response exposes the result.
    provenance: observed
    source: >-
      services-platform:modules/data-jobs/services/jobs/custom-field-data-jobs.ts:parseDatasetLines
  - 'n': 3
    actor_or_service: 'Platform request, after commit'
    action: >-
      After commit, claim workspace queue entries by deletion and run their
      batches sequentially with local retry attempts.
    anchor: >-
      services-platform:modules/data-jobs/services/jobs/custom-field-data-jobs.ts:runQueuedBatches
    seam: sync
    on_failure: >-
      Pause exhausted transient work or fail systemic problems; interruption has
      no scheduled recovery.
    left_inconsistent: Unrun claimed batches can remain pending with no queue entry.
    observer: >-
      Job inspection can show active state and unfinished batches without a
      recovery alarm.
    provenance: inferred
    source: >-
      services-platform:modules/data-jobs/services/jobs/custom-field-data-jobs.ts:runQueuedBatches;
      services-platform:modules/data-jobs/aws/logic/data-jobs-api.lambda.ts
      (30-second function timeout); FND-PFM-DJE-047
  - 'n': 4
    actor_or_service: Owning metadata operations
    action: >-
      Use metadata persistence for each line, including field rules,
      custom-record reach and association limits.
    anchor: >-
      services-platform:modules/data-jobs/services/operations/custom-field-import.ts
    seam: sync
    on_failure: Record line-specific refusals and continue eligible work.
    left_inconsistent: A refused line commits no partial record change.
    observer: Refusals page (API).
    provenance: test
    source: >-
      services-platform:modules/data-jobs/tests/integration/services/jobs/custom-object-data-jobs.integration.spec.js#refuses
      a hull number an earlier line of the same file holds, naming that line
idempotency: >-
  Claiming deletes selected queue entries, reducing ordinary duplicate request
  execution; receipts protect replay of an item. Saved submission keys remain
  indefinitely because Platform has no ledger purge.
concurrency: >-
  A request can claim other jobs in the same workspace and executes with its own
  evaluated permission slice. Custom records also check per-line object scope.
  This lane takes no shared file-batch allocation.
branches:
  - >-
    Migration datasets execute locally under staff grants resolved for the
    destination workspace.
waits: []
evidence:
  - >-
    services-platform at ad3f6a65: services/jobs/custom-field-data-jobs.ts
    (module comment, section 3), data-job-surfaces.ts;
    aws/api/custom-field-data-jobs.routes.ts,
    custom-object-record-data-jobs.routes.ts; aws/logic/data-jobs-api.lambda.ts;
    docs/data-jobs/platform-data-operations.md.
controls: [TC-AVL-001, TC-AVL-004, TC-AVL-005, TC-AZ-001, TC-AZ-002, TC-AZ-003, TC-AZ-004, TC-AZ-005, TC-CHG-001, TC-CHG-002, TC-CHG-003, TC-CHG-004, TC-CHG-005, TC-CHG-006, TC-CHG-007, TC-DAT-001, TC-DAT-002, TC-DAT-003, TC-DAT-004, TC-DAT-006, TC-IAM-001, TC-IAM-002, TC-IAM-003, TC-IAM-004, TC-IAM-005, TC-IAM-006, TC-LOG-001, TC-LOG-004, TC-LOG-005, TC-MON-001, TC-MON-002, TC-PI-001, TC-PI-002, TC-PI-003, TC-PI-004, TC-PI-005, TC-PRV-001, TC-PRV-002, TC-PRV-004, TC-TEN-001, TC-TEN-002, TC-TEN-003, TC-TEN-004, TC-VEN-001, TC-VEN-002, TC-VEN-003]
---

# Run Platform Data Jobs Inside The Submitting Request

## What It Does

Platform parses bounded datasets into the interactive engine model and processes queued workspace batches inside the request. It has a database queue table but no external work queue, worker or recovery schedule.

## The Flow

```mermaid
flowchart TD
  H1["Platform data-job route"] --> H2
  H2["Platform submission"] --> H3
  H3["Platform request, after commit"] --> H4
  H4["Owning metadata operations"]
```

## When Something Fails

An interrupted request can leave pending batches after their queue rows were removed. A running orphan refuses resume and retry until another permitted control changes its state; no recovery schedule or alarm finds it. Bad initial imports recover through workspace reset.

## Open Design Questions

Request interruption requires a concrete recovery choice, such as durable dispatch or a recovery sweep.
