internal
workspaces

Append Workspace County

Insert a single pending workspace_counties row.

The env-matched workspace_county_pickup_{staging,prod} Dagster sensor picks the row up on its next tick (≤30s typical), registers the partition, launches sandbox_load, and the run-status callbacks stamp completion back. workspace_counties is the single source of truth for workspace RBAC — WorkspaceCountyRepository.get_loaded_fips reads it directly.

post/api/v1/internal/workspaces/{workspace_id}/counties

Path parameters

workspace_idstring uuid required

Request body

state_fipsstring required
county_fipsstring required

Response

Successful Response

idstring uuid required
workspace_idstring uuid required
statestring required
county_fipsstring required
county_namestring required
load_status'provisioning' | 'pending' | 'loading' | 'succeeded' | 'failed' | 'canceled' | 'inherited' required

Load status for a workspace-county pair.

Lifecycle: provisioning (initial — set by workspace standup before the Neon project is ready) → pending (set by provision_workspace_op after schema apply succeeds; the pickup sensor's gate value) → loading (set by sandbox_load when it starts writing for one county) → succeeded | failed (terminal, set by the asset's try/finally). provisioning and the mid-load loading were previously the same value; MAIA-2309 split them so the lifecycle reads literally instead of overloading loading across two phases.

canceled is the admin-initiated terminal state: an in-flight (pending/loading) row canceled before the load finished. The Dagster stamps are status-guarded so a canceled row is never resurrected by a run that was already queued; retry via the reload seam re-queues it.

inherited sits outside that lifecycle: the county's data arrived with the workspace's Neon branch and no load ever ran for this workspace. A self-serve workspace is a copy-on-write fork of a prepared parent, so its counties are queryable the moment the branch exists. The distinction from succeeded is what a future refresh needs — re-forking from a refreshed parent carries inherited counties for free and drops separately loaded ones, and without the distinction a refresh either reloads everything or silently loses the one-offs.

A producer writing this status should stamp data_loaded_at with the fork time in the same statement. Access does not depend on it — the reload seam backstops a missing value with now(), so an unstamped inherited row keeps its access through a refresh — but the backstop records when someone first refreshed the county rather than when its data actually arrived, and that column is what a later refresh reads to tell inherited data from data loaded afterwards.

dagster_run_idstring nullable required
requested_atstring date-time required
completed_atstring date-time nullable required
suspended_atstring date-time nullable required
error_messagestring nullable required

Changes

Changed in 1 of the 15 revisions of this API.1

    • added the new inherited enum value to the load_status response property for the response status 200

      response-property-enum-value-added