Runtime Context
| Field | Value |
|---|---|
| Audience | public |
| Page type | reference |
| Area | workflows |
| Updated | 2026-05-14 |
| What this covers | |
| --- | |
| What is this for? | |
| Good use cases | |
| What NOT to use this for | |
| How this connects to other features | |
| Definition | |
| Purpose | |
| Scope | |
| Context dimensions | |
| Where resolution happens | |
| Context propagation across handoffs |
How SGEN keeps site context coherent — runtime resolution that scopes every operation correctly.
Runtime Context in SGEN is the cross-cutting workflow that resolves site and environment context at every operation. Where Site Provisioning sets up a new site and the everyday workflows operate on existing state, Runtime Context is the always-on resolution layer that ensures any given operation runs against the correct site at the correct environment. This page is the Reference definition.
What is this for?
Read this page when you want the structural definition of how SGEN resolves runtime context — what context is resolved per operation, where the resolution happens, and what the operator should expect when context is correct versus when it drifts.
Good use cases
- You are scoping multi-site operations and need the context-resolution model.
- You are explaining to a stakeholder why operations stay scoped to the correct site.
- You hit a "did this change apply to the right site?" question and want the model laid out.
What NOT to use this for
- Step-by-step procedures — open the relevant Guide.
- Per-release shipped change — open What's New or Changelog.
- Internal context-resolution implementation — out of scope.
How this connects to other features
- Workflows Overview — parent Reference area.
- Site Provisioning — workflow that creates the site this Reference resolves context for.
- Shared Concepts — site context vs account context.
- SG-Admin Overview — surface where site-context operations land.
- SG-Builder Overview — surface where page-context operations land.
Definition
Runtime Context in SGEN is the cross-cutting resolution layer that determines which site and which environment an operation belongs to at runtime. The resolution combines the URL the operator is on (account vs site context), the active site (when in site context), the active environment (staging vs live), and the operator's permission scope.
The defining property is always-on. Every operation goes through context resolution; the resolution is invisible when correct and surfaces only when context drifts (e.g., an action lands on the wrong site).
Purpose
The purpose of this page is to define runtime context resolution as a Reference layer. It explains what context resolves per operation, how the resolution propagates, and how context drift is detected and corrected.
Scope
This page covers Runtime Context at the Reference level.
The page covers:
- The context dimensions resolved per operation.
- Where resolution happens.
- Context propagation across handoffs.
- Drift detection and correction.
- Step-by-step procedures — Guides.
- Internal resolution implementation — out of scope.
- Per-release shipped change — What's New or Changelog.
Context dimensions
Account vs site
Whether the operation is account-tier (SG-Dashboard URL pattern) or site-tier ({site}.com/sg-admin/ URL pattern). Resolved from the URL.
Active site
When in site context, which site the operation belongs to. Resolved from the URL host.
Active environment
Staging vs live. Resolved from the environment configuration of the active site.
Operator permission
What the operator is allowed to do at this context. Resolved from the operator's role and per-site / per-account permission grant.
Workflow · Runtime context · Resolved
Current operation context
Where resolution happens
Resolution runs at every request boundary.
Page load
Each page load resolves context from the URL and the operator session.
Action submission
Each action submission re-resolves to confirm the operation still applies to the resolved context (no drift between page load and action click).
Handoff between surfaces
When the operator moves from SG-Dashboard to the admin (or SG-Admin to SG-Builder), the handoff carries the resolved context so the next surface starts in the correct scope.
Context propagation across handoffs
Context propagates by the URL pattern. Switching context is intentional — moving from dashboard.sgen.com/... to {site}.com/sg-admin/... is the operator's deliberate context switch.
Within the same site
All operations stay in the resolved site context until the operator navigates back to SG-Dashboard.
Switching sites
Operators switching between sites do so via SG-Dashboard Site Manager. Direct URL navigation between sites also works but is less guided.
Drift detection
When context resolves unexpectedly (operator on the wrong URL, expired session, permission mismatch), the platform surfaces the drift rather than silently running the wrong operation.
Surface indicators
The breadcrumb at the top of every surface shows the resolved context. Operators see the active site name and environment at all times.
Permission mismatch
If the operator lacks permission for the resolved operation, the action surface either disables the action or routes the operator to the permission grant flow.
Constraints and boundaries
Runtime Context is a Reference area for the cross-cutting context-resolution layer.
Use this Reference for:
- Understanding what context resolves per operation.
- Reasoning about why operations stay scoped correctly.
- Diagnosing context-drift questions at the structural level.
- Internal resolution implementation — out of scope.
- Per-step procedures — Guides.
- Per-release shipped change — What's New or Changelog.
Public boundary
This page is intentionally public-safe.
Examples
Example 1 — Operator publishes a page on the correct site
The operator opens marketing.example/sg-admin/, edits the homepage, publishes. Runtime context resolves to marketing.example throughout; the publish lands on the correct site.
Example 2 — Operator switches sites mid-workday
The operator finishes editing on marketing.example, returns to SG-Dashboard, opens shop.example via the site card. Runtime context resolves to shop.example for all subsequent operations until the next switch.
Example 3 — Permission mismatch surfaces
A new operator with read-only permission tries to publish. Permission resolution surfaces the mismatch; the publish action is disabled with a permission-grant prompt instead of silently failing.
Documentation guidance
Use this page as the structural definition for runtime context resolution. Per-step procedures live in Guides.
Reading order
Open this page when scoping multi-site operations or troubleshooting context-related questions.
Related reading
- Workflows Overview — parent Reference area.
- Site Provisioning — sibling that creates the site this resolves context for.
- Shared Concepts — site context vs account context vocabulary.
- SG-Admin Overview — site-context surface.
- SG-Builder Overview — page-context surface.
Vocabulary cross-reference
- Runtime context is the resolved (account / site / environment / permission) context at any moment.
- Resolution is the act of computing context from URL + session + permission grant.
- Drift is when resolved context does not match operator intent.
- Propagation is how context carries across handoffs between surfaces.
- Context switch is the operator's deliberate move between sites or between account and site tier.
Maintenance discipline
When runtime context behavior changes across releases (new context dimension, new resolution path, new drift detection surface), update this Reference and log the change in Changelog.
Related reading
| Topic |
|---|
| Workflows |
| Site Provisioning Workflow |
| Shared Concepts |
| SG-Admin |
| SG-Builder |
Where to find it
Open your SG-Admin and navigate via the sidebar group that owns this surface. For platform-level reference (this page), the entry point is the SGEN documentation index at docs.sgen.com. For the operator-facing configuration screen, the entry point is the corresponding SG-Admin module page linked in Related features above.
Reference shape
A minimal payload that this surface accepts or emits looks like:
{"site": "your-site.com","surface": "runtime-context","actor": "operator@your-domain.com","timestamp": "2026-04-22T14:03:00Z"}Use this shape when scripting against the surface or when reading audit logs that reference it.
Sample payloads
A runtime context object as it travels across handoffs:
{"site": "your-site.com","actor": "operator@your-domain.com","surface": "sg-builder","request_id": "REQ-2026-04881","locale": "en-US","timestamp": "2026-04-22T14:03:00Z"}A propagated context across a publish handoff:
from: sg-builderto: sg-corecontext:site: your-site.comactor: operator@your-domain.compage_id: 142action: publishA drift-detection diff captured when context fields disagree across surfaces:
{"expected_actor": "operator@your-domain.com","received_actor": "system","surface": "sg-modules/forms","drift_type": "actor-mismatch"}Additional sample
A reduced context emitted to logs:
{"site": "your-site.com","surface": "runtime-context","trace_id": "trc_8821","timestamp": "2026-04-22T14:03:00Z"}