SP4 Polish 2 — materialize an operation tree as a new cohort_definition + cohort table rows in the source's cohort schema.
POST/api/v1/finngen/workbench/materialize
Flow:
- Validate the tree structurally (CohortOperationCompiler).
- Create the cohort_definition row in app.cohort_definitions owned by the caller; store the operation tree under expression_json so the definition round-trips.
- Compile the tree to a subject-id SELECT fragment + collect the referenced cohort IDs (needed for the INSERT that joins back to cohort for start/end dates).
- Dispatch a cohort.materialize Run; caller polls /runs/{id}.
Returns 202 with the Run record + the new cohort_definition_id so the UI can wire the Handoff step to the freshly materialized cohort.
Request
Responses
- 401