Skip to main content

extractionRunId

@forge/monorepo


@forge/monorepo / backend/src / extractionRunId

Function: extractionRunId()

extractionRunId(fileId): RunId

Defined in: backend/src/documents/vision.ts:165

A synthetic run id for a background extraction.

UsageEvent.runId is required, and an extraction is not a run — it has no conversation turn and no agent. Rather than widen the usage ledger with a second identity dimension, the extraction borrows the field with a namespaced value. Two consequences worth knowing:

  • The ledger stays single, which is what AC-4 asks for: one place to answer "what did this tenant spend".
  • usageDedupeKey is (runId, stepId), so a retried extraction of the same file records once. That is not incidental — vision calls are the expensive kind, and a re-enqueued job double-charging a tenant is the failure this shape prevents.

The wart is that runId no longer always names a run. Flagged rather than hidden; a separate cost dimension would be the cleaner answer if the ledger ever needs to distinguish them.

Parameters

fileId

string

Returns

RunId