First-class methodRunId / invocationId on DataRecord
Opened by keeb · 4/9/2026
Problem
After PR #1145 promoted workflow provenance fields (workflowRunId, workflowName, jobName, stepName, source, ownerRef) to first-class DataRecord fields, one provenance dimension is still missing: the identity of the specific method invocation that produced a record.
Workflows have workflowRunId. Workflow steps have stepName + jobName. But a single method invocation — whether triggered by swamp model method run or by a workflow step — has no identifier on its outputs. Two invocations of the same method on the same model produce records that are indistinguishable except by createdAt (per-record, not per-invocation) or version (per-data-name, doesn't correlate across data names).
What's missing
A methodRunId (or invocationId) field, peer to workflowRunId. Properties:
- Generated by the framework at the start of every method invocation, manual or workflow-triggered
- Set on every data record the invocation produces
- First-class queryable: in
QUERY_FIELDS, indexed in the catalog, populated during backfill - Always populated — never empty
Same shape of change as PR #1145.
What it unlocks
# All data from a specific invocation
methodRunId == "abc-123"
# Per-item records from the latest run of a model
modelName == "X" && methodRunId == data.latestMethodRunId("X")The latter case is the one that has no clean expression today. Workarounds (batch manifests, createdAt clustering, per-extension tagging conventions) all push a missing primitive into the extension layer.
Why this is not "execution identity scoping"
Earlier discussion (#1123) rejected automatic scoping by execution identity. That was about hidden framework-injected filters. This is the opposite: methodRunId is a plain queryable field that authors compose into predicates explicitly. No auto-injection. The framework's job is just to expose the field.
Out of scope
- Per-invocation execution metadata beyond identity (timestamps, duration, status) — separate
- A
data.latestMethodRunId(modelName)helper — sugar that could come later
Open
No activity in this phase yet.
Sign in to post a ripple.