Skip to content

This page is for integrators and engineers who drive packaging through the API, build tooling around packages, or need to know exactly what the export and import engine does. It explains how the engine fits together, the rules it enforces, and how it resolves dependencies, and it points to the reference pages for the archive format, the import wire contract and the marketplace.

Packaging moves a set of built platform resources — modules, entities, views, queries, relations, reactions, reports, pages (generic views), system buttons, collections, statistic queries, counter widgets, functions, announcements — from one environment (or space) to another, along with everything they depend on. A package is a single ZIP that bundles the selected resources with the entry-level data, shared data-store rules and template/binary files they need. It is the mechanism behind the usual development → staging → production promotion path.

You needPage
The engine, its access rules and how it resolves dependenciesThis page
Exactly which files a package ZIP contains, every manifest field, the import-time limits and validatorThe package format
The JSON shape inside each resource filePackage resource schemas
The edges in dependencies.json and how they drive remapping and orderingThe dependency graph
Every import-session endpoint, the state machine, the session document and concurrency rulesThe import API
Which schemaVersion values exist and which environments accept themSchema versioning
Producing or transforming a package programmaticallyGenerating a package
Packages, versions, publish requests, the marketplace, installs and updatesPackages, Marketplace & the In-App Store
The older single-file module/entity JSON transferModule JSON transfer

Packaging is split across two services, both LoopBack 4 and both Auth2-guarded:

ServiceBase pathRole
packaging-service/api/packagingExport pipeline, import validation/execution, sessions, overrides, mapping profiles
dependency-service/api/dependencyDirected dependency graph; supplies edges, dependents-tree, topological order

A package is produced by an export job and consumed by an import session. Both long-running operations run asynchronously on BullMQ (Redis-backed) workers: the HTTP endpoints enqueue work and return a job or session id that you poll for status.

Every packaging controller is annotated @authenticate with the Auth2 strategy, and every endpoint requires an x-space-id request header — a missing header answers 400 x-space-id header is required.

flowchart LR
  subgraph EXPORT["Export (source space)"]
    E1[Selection] --> E2[Resolve dependencies]
    E2 --> E3[Fetch snapshots]
    E3 --> E4[Build ZIP]
    E4 --> E5[Upload to storage]
    E5 --> E6["Job result: fileId, name"]
  end
  subgraph IMPORT["Import (target space)"]
    I1[Upload ZIP] --> I2["Validate (phase 1)"]
    I2 --> I3["Session: validated"]
    I3 --> I4["Configure mappings (auto-save)"]
    I4 --> I5["Execute (phase 2, async)"]
    I5 --> I6["Session: completed / failed"]
  end
  E6 -. ZIP file .-> I1

An export takes a selection of root resources, resolves what they depend on, and writes the ZIP. In the web app this is the Export resources page under Packages › Build (see the builder guide); through the API it is the endpoints below.

Tip: Always run the export analysis first and resolve external-dependency warnings before shipping a package. A resource whose hard dependency is missing from the package will fail to import cleanly.

Every package carries a manifest describing the source (schema version, source environment, source space, source version) and a topologically sorted set of resources — parents before children. The exporter follows the hard dependency edges of your selection so the package is self-contained; soft (optional) references are recorded but not followed. Entry-level references, shared data-store rules, and the template/widget/page binary files your resources need are collected alongside. The archive itself is specified in The package format.

All export endpoints live under /api/packaging/v1/export. They share the ExportRequest body and the x-space-id guard.

MethodPathPurposeReturns
POST/v1/export/previewAccurate resource counts after the real fetch+filter pipelineExportPreviewResponse
POST/v1/export/analysisMerged preview + external-dependency analysis in one round-tripAnalyzeExportResponse
POST/v1/exportEnqueue an export job and, Since 1.10, write its export record{ jobId, exportId }
GET/v1/export/{jobId}/statusPoll job state + resultExportStatusResponse

GET /status enforces that the caller’s space owns the job (403 Access denied to this export job otherwise) and, Since 1.10, that the caller is the user who started it or a system administrator — anyone else gets 404, as if the job did not exist. On success the status result carries the storage fileId and generated name; the downloadable ZIP lives in storage-service as a temporary file. The filename is the export’s English name, else its Arabic name, sanitised to [a-zA-Z0-9_-]; when that leaves nothing (an Arabic-only name, for instance) it falls back to <NAMESPACE>-package-<ISO-timestamp>.zip.

The preview returns counts by type and entity; the analysis adds the external-dependency analysis — everything the selection references outside itself, grouped by module, with unresolved external dependencies surfaced as warnings.

FieldTypeNotes
resourcesResourceRef[]Required (≥1, else 400 At least one resource is required). Each ref is {type, id, withChildren?}.
excludesResourceRef[]Specific (type,id) pairs to drop from the resolved set.
excludeTypesResourceType[]Whole resource types to drop from the resolved set.
descriptionstringFree text, stored in manifest.description.
nameILocalizedValue ({en?, ar?})Since 1.10 required by POST /v1/export: 400 EXPORT_NAME_REQUIRED when neither language has text (preview and analysis ignore it). It names the export’s origin and the ZIP file (see above). On 1.8 it was an optional plain string.
maxClosureRoundsnumberDepth of transitive entry-reference closure. Default 5; 0 disables (direct edges only). Higher = deeper nested-entry capture at the cost of more API calls and a larger package.

ResourceRef.withChildren triggers “smart resolution”: for DataModule and DataEntity the service expands the MEMBERSHIP dependents tree from dependency-service and pulls in the children (user-scoped and external children excluded). In the web app, ticking a module or entity node sends it with withChildren.

A plain export carries no README Since 1.10. POST /v1/export has no readme field. The README belongs to a package and its versions (edited on the package page and written into each version’s ZIP), and the import side still reads and keeps a README it finds in a file. The request-body limit of POST /v1/export is 30 MiB (413 PAYLOAD_TOO_LARGE beyond that).

Every POST /v1/export writes an export record before it queues the job, so the Build page’s Exports tab can list past exports, reopen one, and start the same export again (the export page opens with ?from=<exportId>). The response is {jobId, exportId}, where the job id is export-<exportId>; poll GET /v1/export/{jobId}/status as usual.

MethodPathPurpose
GET/v1/exportsThe space’s export records, newest first, with total. Paged by skip (default 0) and limit (default 50, at most 100).
GET/v1/exports/{id}One record with its selection (resources, excludes, excludeTypes), to start the same export again. Another space’s id is 404 EXPORT_NOT_FOUND.
DELETE/v1/exports/{id}Deletes the record only.

All three are open to anyone who could start an export (a Developer somewhere — see Export access). A record carries id, name, description?, resourceCount (the selection as sent), packagedCount? (what the package held once dependencies were resolved), status (running, completed or failed), createdBy, createdAt, completedAt?, fileId?, size? and failedReason?. A running record whose job has already ended is brought up to date when it is read; one whose job can no longer be found after 60 seconds becomes failed with EXPORT_JOB_LOST.

Deleting a record does not delete the ZIP. The file stays in storage, and a job that is still running still finishes. Conversely, a plain export’s ZIP is a temporary file, so a record’s fileId can point at a file that has already expired.

Exporting is a developer action, not an administrator one. POST /v1/export, /v1/export/preview and /v1/export/analysis are authorised against the roots in resources:

  • a system grant of Developer or higher may export any roots;
  • a system grant of None refuses, whatever the resource-level grants say;
  • otherwise every root needs Developer or higher on the module or entity that owns it — a module by its module grant; an entity by its entity grant, else its module’s; a collection by its entity (only when the collection and the entity are in the same module); a page (generic view) by the module it belongs to. Any other root type, or an empty list, needs the system grant.

The export page and its resource tree mirror this: they open for module developers and offer only the roots the user can develop.

The export itself refuses resources that belong to an installed package with 403 EXPORT_INSTALLED_RESOURCE (details.resourceIds, packageId): an installed template is the publisher’s to ship, not yours. See installed resources.

EXPORTABLE_TYPES — only these types are written to resources/ in the ZIP:

DataEntity, DataView, DataQuery, DataRelation, DataCollection, DataReaction, GenericView, DataModule, SystemButton, StatisticQuery, Report, Function, CounterWidget, Announcement, DataEntityAggregate (Since 1.10), QuickFilterGroup and TagGroup (both Since 1.10).

The two group types travel as entity children. On import their id and dataEntity are never written (the entity comes from the target path), normalizedName is the identity used to match an existing group, and an update changes only name and queries — a tag group’s color cannot change on update either.

isNonExportableResource filters out, even when selected:

  • Archived entities (state === Archived) — and their whole nested subtree cascades out.
  • User-scoped resources.
  • Implicit DataEntity (unless implicitOptions.allowEdit) and any implicit DataReaction.

Core identity entities — USER, GROUP, ORGUNIT, WORKING_HOURS (CORE_ENTITY_IDS) — are never written as resources; they exist independently in every environment and are handled as references (see Value references).

PackageExportService.executeExport runs, in order:

  1. Resolve selections — expand withChildren, apply excludes / excludeTypes, dedupe by (type,id).
  2. Fetch + filter — batch-fetch full JSON snapshots per type from data-service (projection value,dataEntity,state for entries), key each by a unique normalizedName (collision-suffixed with the id), then apply isNonExportableResource and the archived-subtree cascade.
  3. Clear entity-collection items — non-ADT DataCollection snapshots are exported with items: [] (they reference DataEntry ids not in the package); ADT collections keep their embedded scalar items.
  4. Since dev Strip function secrets from every packaged Function — see below.
  5. Collect cross-cutting payloads — entry references (value-level refs to core/entry UUIDs, with transitive closure), shared stores (storeRules with type === 2), and template/binary file references.
  6. Strip server-managed fields (SERVER_MANAGED_KEYS, e.g. creationInfo/updateInfo) and executionPlan from views — import re-derives them.
  7. Build manifest + index, topologically sort resources (Kahn’s algorithm over hard edges), stream the ZIP via archiver (zlib level 6), and upload to storage-service. Streaming keeps worker memory bounded (~16 MB highwater) so multi-hundred-MB exports do not run out of memory.

Function secrets stay in their environment Since dev

Section titled “Function secrets stay in their environment Since dev”

On the development line a function can hold encrypted secrets and has its own identity (an application user); see Function secrets and per-function identity. Packaging never moves a secret’s value or a function’s identity between environments, because the ciphertext is bound to the source environment’s keys.

StepWhat happens to a Function
ExportEach secret row keeps its key (and any other field) but its value becomes null; the system-managed OSOS_API_TOKEN row and the identity reference are removed. This runs before the export collects entry references, so the identity cannot pull the function’s user record into the package. A function that is only referenced by an exported resource is stripped the same way.
Content hashThe hash covers the secret names, in order, and nothing the target sets for itself, so an installed function still hashes equal to its package however its secrets are filled in later.
Install (create)The packaged value is stripped again, so a package exported before this rule existed — which may still carry the source’s ciphertext, token row and identity — cannot plant them in the target.
Update of an installed functionThe target’s own state is carried over: its identity, its OSOS_API_TOKEN row, and the stored value of every secret whose key the package still declares. Secrets the package no longer declares are dropped; newly declared names arrive empty. The update always reads the target first, and fails rather than writing blind if that read fails.

Nothing in packaging requires a secret to be set: a freshly installed function holds the declared names with empty values until an administrator of the target fills them in.

The archive layout, every manifest field, index.json, dependencies.json, the mapped-field sidecar, the published-version files, the import-time safety limits and the strict validator are specified in The package format. Which schemaVersion values exist, which environments accept them, and how validation treats sourceVersion and per-resource specificationVersion, are in Schema versioning. Format versioning is independent of the platform release, and older packages remain importable by design.

Importing is a session-based flow in three stages. Each import creates an import session that tracks progress and can be retried or cancelled. The wire contract for every stage — bodies, responses, status gates and the concurrency token — is The import API; this section explains what the engine does at each stage. In the web app the flow is Packages › Installed › Install from file (see the builder guide).

A ZIP whose manifest carries a package block is a published package version and is imported as an install — see Installing.

POST /v1/import/validate takes {fileId, fileName?, importStrategy?}, downloads the ZIP from storage-service, and runs ValidationService.validate, which:

  1. Extracts and validates the ZIP and checks schemaVersion.
  2. Classifies each exportable resource against the target space, resolving the correct scope (entity-scoped, module-scoped, or global — see resolveResourceScope) and matching by normalizedName (batched per type, with entity/module-filtered re-queries and an id-based fallback). Result per resource: NEW or EXISTING (ValidationStatus).
  3. Generates default resource mappings: NEW → CREATE; EXISTING → SKIP (or OVERWRITE when the strategy is OVERWRITE_ALL).
  4. Enriches with dependency metadata (dependsOn, requiredBy, module ownership, cascadeSkipCount), detects unmapped dependencies (hard external refs not in the package, and Since dev page-widget references to something outside it), and detects value references.
  5. Persists an ImportSession (status validated, or failed/non-proceedable when there are blocking errors) and returns {sessionId, validationReport, updateIdentifier}.

The ValidationReport (resources, errors, warnings, canProceed, unmappedDependencies?, availableTargets?, and Since 1.10 mappedFields?) lets you review everything before any write. Validation is read-only: nothing is written to the target yet. Identity collisions and unmapped dependencies are surfaced here for your attention.

After a successful validation the web app reloads the new session to show the server-resolved value references. If that reload fails, it still opens the review step with the report it already holds, and says that the value references could not be loaded. Since 1.8

Configuration decides how each resource lands in the target. It auto-saves with optimistic locking, so two people editing the same session cannot silently overwrite each other. PATCH /…/config is deliberately relaxed — every section is optional and hard constraints are deferred to execute. It merges resource mappings, value-reference choices and unmapped-dependency targets, prunes stale value references, re-runs the AUTO_CREATE nested-reference guard, and returns a dependencyImpact / mappingSummary. Since 1.10 the same save carries mappedFieldDecisions and answers with the recomputed mappedFields and canProceed (see Mapped fields).

Per-resource action (MappingAction). The wire values are CREATE, OVERWRITE and SKIP; the web app presents them as four outcomes:

OutcomeOn the wireMeaning
CreateCREATECreate the resource new in the target, with a new id.
Map (reuse)SKIP with a targetId on an EXISTING resourceLeave the existing target resource untouched; the id mapping is still registered, so references from other imported resources resolve to it.
OverwriteOVERWRITEReplace the existing target resource with the packaged version.
SkipSKIPDo not import this resource. For a NEW resource, its hard dependents are cascade-skipped.

You can also:

  • Apply a bulk strategy across all mappings via PATCH /…/strategy — Manual, Merge new only (MERGE_NEW_ONLY) or Overwrite all (OVERWRITE_ALL) — preserving user-chosen module remaps.
  • Accept exact-match suggestions (PATCH /…/suggestions/accept-exact) to bulk-convert every unactioned exact-confidence principal suggestion into a REMAP to its suggested target.
  • Remap principals — map users, groups and org units from source to target. Mapping profiles remember these between a given source and target so the next import lines them up automatically.
  • Decide what each mapped field copies from when the import cannot work it out (see Mapped fields).
  • Optionally hand-edit a resource’s payload (a payload override) before import.

POST /…/execute first checks that every unmapped dependency, mapped field and value reference the run needs is resolved, and Since 1.10 that the tenant has room for every entry the run will create; the full gate sequence and its error codes are in The import API. It then atomically transitions validated → importing (a double-execute guard), enqueues a BullMQ import job, and persists importJobId.

The engine imports resources in dependency order, performing id remapping so each source identifier is translated to the correct target identifier as resources are created, and handles the hard cases automatically — cascade-skip, cycle-breaking, soft-dependency nulling, value-reference handling and a retry pass (see Dependency resolution and remapping).

  • Retry (POST /…/retry) re-enqueues, resetting failed and cascade-skipped rows to pending and re-attempting only what did not land. Executing a session already in failed/completed delegates to retry. Prefer retry over re-importing from scratch.
  • Cancel (POST /…/cancel) stops a queued or running import; resources already written remain. Since 1.10 a cancel is final — start a new import.

Between validate and execute, a caller may replace a single resource’s JSON for the next execution; the archive stays untouched. In the web app this is Edit JSON on a resource row, which opens an embedded code editor with syntax highlighting. The endpoints, validation rules and status gates are in The import API; when to use them rather than transform the ZIP is in Generating a package.

Import access and execution guards Since 1.10

Section titled “Import access and execution guards Since 1.10”
  • Import is space-admin only. Validate, configure, execute, retry, cancel, payload overrides and mapping profiles all require a system-level administrator grant (or a service call). Import writes skip per-resource grants in data-service, so the gate is at the door. Export is the opposite — Developer on the exported roots.
  • Value references need an explicit action. Execute answers 400 VALUE_REFERENCE_ACTION_UNSET while a value reference the import will write has no action and no safe default, rather than writing a source id into the target.
  • No silent principal creation. An Auto-create of a reference whose identity — a user’s email or username, for example — already matches an entry in the target is refused for that reference (VALUE_REFERENCE_IDENTITY_COLLISION); and principals you did not choose are never auto-created.
  • Archived targets are not “Existing”. A package resource that would match an archived target is a blocking TARGET_ARCHIVED error, instead of overwriting an archived record; a retry re-checks.
  • Installed resources are not overwritten. A plain import that would write a resource owned by a package installation is refused with 409 TARGET_INSTALLED; fork the installation first (Fork and uninstall).
  • Entity indexes are replaced, and impossible ones dropped. An entity update always carries its indexes, so an import replaces the target entity’s custom indexes with the packaged ones (the server-managed index status is never exported or written). A custom index whose field path the target cannot index — the path is missing, has a shape data-service cannot index, or names a language the target does not have — is dropped and reported in the result’s importWarnings (Dropped index "<name>": field path <path> …) instead of failing the whole entity.
  • Mapped fields need a decision. A mapped field whose source the import cannot find is a blocking validation error until the installer chooses what it copies from, or chooses not to copy (see Mapped fields).
  • The entries limit is checked before the run. Before an install or a retry starts, packaging asks whether the tenant has room for all the entries the run will create, and refuses with 403 ENTRY_CAP_EXCEEDED (“Archive or delete entries, or upgrade the plan, then install again”) when it has not. Nothing is written. If the check itself fails for another reason, that is logged and the run goes on, because every individual create is still checked.
  • Files that could not be transferred are dropped, not fatal. A resource still carrying a file id from the source tenant — because the export could not download the file, or the import could not upload it — has that file removed (cleared, dropped from an array, or the thumbnail removed) and an import warning recorded. A file id that already resolves in the target storage, as in a same-tenant import, is kept.
  • A page whose widget points outside the package still installs. A statistic-query widget on a page whose data entry was not mapped is left unconfigured — the same state the widget editor produces — instead of failing the page with UNRESOLVED_PAYLOAD_REFERENCES. Navigation nodes and dashboards still fail explicitly.

Nulled principal references leave arrays and fail closed Since 1.4. When the import clears a value reference that sits inside a reference array — a service’s authenticated audience, say — the entry is removed from the array rather than left as a null slot. And when that empties both the users and the groups of a view’s redirection rule, the rule becomes Restricted, matching nobody, instead of widening to every authenticated user. The rule applies on every supported line (1.4, 1.6, 1.8 and later), and a data-service migration repairs rules that already held a null.

The hardest part of import is turning source-environment UUIDs into valid target-environment references. The engine pre-computes a target identifier for each resource it will create, so references can be rewritten even before the referenced resource physically exists — this is what allows the import to run in a single dependency-ordered pass. Dependencies come in two strengths: hard dependencies must exist for a resource to be valid (a view depends on its entity); they are followed on export and gate the import. Soft dependencies are optional, recorded but not followed on export, and nulled on import if they cannot be resolved. The edge format the engine reads is documented in The dependency graph.

A value reference is an entry-level UUID embedded in a resource field that points at an entry in a core or other entity (for example a reaction referencing a specific USER or ORGUNIT entry, or a DataCollection item). ValueReferenceItemModel records the entryId, entityType, occurrences (every path where it appears), whether it existsInTarget, any identity-match candidate (existing), and the chosen ValueReferenceAction:

ActionEffect at import
KEEPReuse the same entry (valid when it exists in target).
REMAPPoint the reference at a chosen target entry (remapTargetId).
NULLClear the reference.
AUTO_CREATERecreate the entry in the target from the packaged entryData (parent-first for nested entries).

AUTO_CREATE entries are only created when at least one referencing resource is actually written (CREATE/OVERWRITE); references consumed only by skipped or mapped resources are marked skipped (“not needed”). GROUP entries are created in their concrete source entity (sourceEntityType, e.g. ROLE, ORGUNIT, USERS_GROUP).

The packaged entryData (and any sourceEntryData) of a value reference is returned intact by GET /v1/import/{sessionId} and is never stripped from the session. That payload is what makes Auto-create an option at all: the wizard offers the action, renders the inline entry-payload editor, and computes nested-reference badges from it. A reference that arrives with no packaged payload can only be kept, remapped, or cleared.

Targets must be live. The entry index deliberately retains archived entries, so existence alone is not enough:

  • A REMAP target must be live: a configuration save that points a reference at a non-Active entry is rejected with 400, matching what the wizard’s own entry picker offers. This catches a target archived after the picker listed it — or after a stored mapping profile last confirmed it. An entry whose lifecycle state is not reported at all stays permitted.
  • The automatic KEEP (from existsInTarget) is held to the same bar: an archived index hit is treated as absent, so the reference falls through to the profile and natural-key stages instead of being kept onto an archived, unresolvable target.

Mapped fields: the installer decides Since 1.10

Section titled “Mapped fields: the installer decides Since 1.10”

A mapped field mirrors a value from a parent entity — an order line showing its order’s customer, say. It records which field on the parent it copies by that field’s identifier, and identifiers do not survive the move between environments: the parent entity is usually matched onto an entity that already exists in the target, so the parent keeps the target’s own identifiers and the packaged one names nothing there. Import first repairs this by matching on the field’s name instead, which is stable across environments. The name travels in the field-mapping-hints.json sidecar that schema 1.2 added; without it, import can only read the name off the parent entity’s own copy inside the package.

When the name match fails, the installer decides what the field copies from — copy from a field on the target parent, or don’t copy — and the run does not start until every such field is decided. Only fields of the same type, with compatible relation targets and (for two-way mappings) matching required-ness are offered, and the list may be empty. A decision belongs to the target parent it was made for: change what the parent maps to and a decision that no longer fits is discarded. A store install or update that runs without the wizard cannot decide for you: an undecided mapped field comes back among the choices you must make on the import page.

The per-field state values, the candidate rules, the decision payload and the execute-time refusals (MAPPED_FIELD_SOURCE_UNDECIDED, MAPPED_FIELD_SOURCE_UNAVAILABLE) are specified in The import API.

External dependencies, explained Since 1.10

Section titled “External dependencies, explained Since 1.10”

A package that refers to something it does not carry — typically an entity another module owns — lists it as an external dependency, and also says why. Each such item (in a published version’s manifest, and in the unmapped dependencies an installer sees) carries usedBy — what in the package uses it: a field that references it, a mapped field that copies one of its fields (naming the parent field copied), or some other use with no field, such as a view naming the entity — and requiredFields, the fields the target entity must offer for those copies to work. The publish view and the install wizard both show this (“Used by …”, “field copies its source field”), so an installer can pick the right entity to map the dependency to before deciding the copied fields above.

When publishing refuses an identifier left inside a written value (PUBLISH_DEPENDENCY_REFERENCE_UNSUPPORTED), the problem names the resource — type, id and name — and, for a field assignment such as a reaction’s, the field.

Page widgets pointing outside the package Since dev

Section titled “Page widgets pointing outside the package Since dev”

A page widget’s reference (a data-view widget’s source or target, and every other widget option the dependency graph reads) is a soft edge. On the 1.10 line, publishing declares only hard external targets, and the import nulls such a soft reference without asking, so the widget installs broken. On the development line such references can be mapped:

  • Publish also declares a soft external target in the version’s external dependencies when one of its uses is a page-widget reference: the using resource is a page (GenericView), the reference sits under one of its widgets (components[n] or groups[n], but not under a widget’s visibility settings), and the target is not a module. It is declared without becoming a package dependency.
  • Install validation offers a mapping for every external reference that is hard or such a page-widget reference. The row in unmappedDependencies carries hard: false when every use is a page-widget reference (no hard field means hard). The page’s own dependency on it stays soft, so cascade-skip and impact counts do not change. A soft target that is scoped to an entity (a view, say) gets no name-based suggestion, because the reference does not say which entity it belongs to and such names are unique only inside one; a target that exists under the same id in this environment is still suggested.
  • Mapped, the widget points at the chosen resource. Left unmapped, the widget’s reference is nulled. The import page tags the row Optional (its tooltip: “Only page widgets use this. If you leave it unmapped, those widgets are cleared and the import continues.”) and does not hold Execute back for it. A widget’s reference to a module is never offered, and other soft page references — sharing, domain, visibility principals — are unchanged.

A workflow step whose owner is Fixed must have a primary owner: data-service rejects an entity whose workflows[n].steps[n].owner.source.value is empty. Packaging enforces the same rule on the way in — a value reference whose action would clear that path (NULL) on a resource the import is actually going to write (CREATE or OVERWRITE) is blocked. A step’s fallbackOwner[n].source.value is deliberately excluded, because a fallback owner is optional.

The guard fires at three points, and each evaluates the effective state after your change rather than the change in isolation:

WhereWhat you see
Validation (Phase 1)A blocking REQUIRED_OWNER_REFERENCE_CLEARED error in the validation report, with canProceed: false.
Saving the configurationThe auto-save is rejected with 400. A mappings-only save is caught too, when it re-activates a resource whose owner was cleared earlier.
Applying a bulk strategyA bulk flip from Skip to Create/Overwrite that re-exposes a cleared owner is rejected the same way.

To clear the block, give the owner a real target: Remap the reference to a principal that exists in the target space, or Auto-create it from the packaged payload. Keep and Clear are not options once the guard has fired. Flipping the owning resource back to Skip also lifts it — the guard only considers resources the import will write, so the now-moot error is dropped from the report and canProceed is recomputed.

Two rules govern what the import wizard sends when a reference’s target changes. Both matter most when a stored mapping profile has already pre-filled the row:

  • A chosen target wins over the row’s default. Picking a concrete target is sent as an explicit remap even when REMAP is already the row’s default action. A reference restored from a stored profile reloads with both its action and its default set to REMAP, so re-pointing only the target must still be sent, or the stale profile target would be kept.
  • Per-occurrence targets survive the save. When one principal appears at several paths (the same fallback owner on several workflow steps, say), the target can be overridden for a single occurrence. Choosing a target for one occurrence also records the row’s action on that occurrence, so the override is complete enough to be sent; clearing the target back to the row’s default drops the override and the occurrence re-inherits from the row. Re-targeting a single occurrence additionally promotes a Skipped owning resource to Overwrite, since a reference change only takes effect if the resource is actually written.

A reference whose decision came from a stored mapping profile is labelled as such in the wizard — a Profile pill in place of the natural-key-match pill — and carries a Saved mapping unavailable warning pill when the remembered target no longer resolves.

A shared principal remapped per resource Since 1.8

Section titled “A shared principal remapped per resource Since 1.8”

When the same principal — one user, group, or org unit — is referenced from more than one resource in the same import (a workflow step owner on an entity, say, and the user a view is restricted to), each resource’s copy of that reference is retargetable independently. The wizard recognises that a principal renders under more than one resource row, and lets each resource’s group read and write only its own occurrences. A principal confined to a single resource keeps using the row-level decision, which is also what a stored mapping profile remembers.

The row-level default is kept when one group diverges. An occurrence-level choice is only ever a partial override layered on the principal’s row-level decision, and the server rejects an item-level remap that carries no target of its own. So the first target chosen for a shared principal also establishes the row’s default; a later group for the same principal then diverges against that default instead of replacing it. That is what makes a choice made during Configure survive through to Execute, including for a principal that had no row-level target yet.

Auto-create on a principal that spans resources always applies at the row level rather than as a per-occurrence override — auto-created entries are keyed by the principal itself, not by where it happens to appear.

Cascade skip, cycles, and soft-dependency nulling

Section titled “Cascade skip, cycles, and soft-dependency nulling”
  • Cascade skip — if a hard dependency is skipped or fails, all its hard dependents are cascade-skipped (cascade_skipped) before any writes.
  • Cycle breaking — hard-dependency cycles between DataEntitys are detected (SCC) and broken: a member is stubbed on CREATE, then PATCHed with real cross-cycle refs once every member exists.
  • Soft-dependency nulling — an unresolvable soft dependency’s path is set to null rather than left as a broken source UUID (with type-specific exceptions, e.g. dataSource.query is left intact so data-service can surface a clearer error). Since dev a page widget’s reference to something outside the package can be mapped instead.
  • Retry queue — resources failing with a “missing target dependency” code (DATA_QUERY_NOT_EXIST, DATA_ENTITY_NOT_EXIST, DATA_VIEW_NOT_EXIST, DATA_COLLECTION_NOT_EXIST, RELATION_NOT_EXIST) are retried once after the main loop, after implicit-child discovery has populated the id map.

Both export and import re-sort resources with topologicalSort (Kahn’s algorithm over hard edges) so parents are created before children (e.g. DataEntity before its DataView). Import re-sorts even if the package was older or unsorted.

dependency-service (/api/dependency) owns the dependency graph and is queried by packaging during export (outbound closure, dependents-tree for withChildren) and consumed at import via dependencies.json. Stored edges carry fromType/fromId, toType/toId, kind (MEMBERSHIP or REFERENCE — the only two DependencyKind values), hard (blocks target deletion), path, resolvedVia (DIRECT_ID / NORMALIZED_NAME / REFERENCE_PROPERTY / PIPELINE_STAGE) and resourceVersion (SHA-256 of the snapshot, for idempotent rebuilds). The wire shape of an edge is in The dependency graph. The read endpoints:

MethodPathPurpose
GET/v1/dependencies/{type}/{id}Outgoing edges (what does this depend on?)
GET/v1/dependents/{type}/{id}Incoming edges (what depends on this?)
GET/v1/validate-delete/{type}/{id}Hard vs soft dependents (safe-delete)
GET/v1/impact/{type}/{id}Transitive impact analysis
GET/v1/external-dependents/{type}/{id}Since 1.10. What outside a module or entity references it or anything it owns — the list the module-delete, entity-delete and uninstall dialogs show

Edges are extracted by a declarative schema DSL and rebuilt event-driven (RabbitMQ lifecycle events → BullMQ workers).

After a successful import, confirmed principal (USER/GROUP/ORGUNIT) mappings are persisted as a MappingProfile keyed by (sourceEnvironmentId, sourceSpaceId, targetSpaceId). A later import from the same source pre-applies those decisions before natural-key matching, so repeat promotions inherit prior choices.

What is remembered:

  • At most one decision per source principal. A principal remapped per resource whose occurrences disagree is not persisted as a REMAP (the divergent choice would otherwise be re-applied to every occurrence next time). A successful AUTO_CREATE or an item-level NULL clear is unaffected, since neither is ever an occurrence-promoted value.
  • A confirmed REMAP is remembered Since 1.10. An empty per-occurrence override counts as no override, so it does not make a principal look divergent; the principal you remapped is pre-applied on the next import from the same source. (On 1.8, saving the configuration stored every unset override as an explicit empty value, so in practice only auto-created principals reached the profile.)

Admin API (mapping-profile.controller.ts, space-admin gated, scoped to x-space-id):

MethodPathPurpose
GET/v1/admin/mapping-profiles/countCount profiles for the space
GET/v1/admin/mapping-profilesList profile summaries
DELETE/v1/admin/mapping-profiles/{profileId}Delete a whole profile
DELETE/v1/admin/mapping-profiles/{profileId}/entries/{sourcePrincipalId}Delete one remembered entry

MappingProfileEntry: sourcePrincipalId, action (remap default / clear), targetPrincipalId?, entityType, matchedBy?, confidence?, updatedAt. Deletes take effect on the next import session. A cross-space or missing profile id returns 404 (never leaks existence in another space).

Before a remembered targetPrincipalId is re-applied, OSOS checks that the principal is still Active — liveness, not mere presence in the index. A remembered entry whose target has since been archived is treated as stale exactly like a deleted one: it is not applied as a live remap, the reference falls through to natural-key matching, and the row is flagged (profileTargetMissing) with a PROFILE_TARGET_MISSING warning so the wizard can mark it visibly. Unlike a deleted target, an archived target is not pruned from the stored profile — archiving is reversible, so the remembered decision survives it and takes effect again once the principal is restored. Only entries whose target has disappeared from the index entirely are dropped.

DataCollection is an exportable type but needs special handling:

  • Non-ADT (entity-backed) collections are exported with items: [] — their items are DataEntry UUIDs not carried in the package, so keeping them would create dangling references. ADT collections (whose dataEntity is a primitive ADT constant like ADTString) keep their embedded scalar items.
  • Collections are scoped: entity-scoped when dataEntity is a real entity UUID, global when it is an ADT constant. Scope drives the existing-resource match at validation and the ZIP lookup key.
  • Global/ADT collections have no module membership edge to climb, so during export dependency-analysis they are surfaced under a synthetic “Global” group rather than dropped.
  • Collection items referenced by other resources are treated as value references with entityResourceType = DataCollection; existence checks and AUTO_CREATE use the DataCollection APIs instead of the entry-index APIs.

An import session moves through validating → validated → importing → completed (or failed). It can be executed only once — concurrent execute/retry/cancel attempts are resolved atomically — a session stuck in importing after a worker crash is recovered to failed so a retry can unblock it, and a retry re-attempts only the failed and cascade-skipped resources. The full transition table and the recovery window are in The import API.

The Packages menu holds four screens: Store, Installed, Build and Reviews. How a builder uses them is in Export, import and install apps; their routes and visibility rules are in the marketplace page. The behaviours below are the ones that matter when you build on, test, or support those screens.

  • Build (/admin/packages/build) has two tabs: Packages (sortable by any column; a package’s Delete stays visible but disabled, with the reason, while the package has versions) and Exports (/admin/packages/build/exports, the export records). Old /admin/packages/mine/... addresses redirect to /build/....
  • The package page (/admin/packages/build/{packageId}) edits the name and description in place (Enter or Ctrl/Cmd+Enter saves, Esc cancels). Download, in the header beside View in store, exports the package’s modules as a file and is shown to developers while the package still has a module that exists. Unpublish, Republish and, for a package without versions, Delete sit in the ⋯ menu.
  • Contents (the default tab) is one list of what the next version will hold — Modules, Referenced records, Pages and Depends on — each row saying what changed since the newest version, with an arrow that opens the changed items. A deleted module or page says what to do in its row. Referenced records are the records the package’s settings point to (a workflow’s owner group, say), of which the package carries a copy.
  • README closes the Contents list and is marked when it changed. Markdown pasted into the README editor as plain text — headings, code fences, quotes, tables, bold, links, inline code, or two or more list lines — is converted to formatted text as one undo step. Since 1.10 (from 1.10.2) the section says, before a version exists, that the next version keeps a copy of this README — or warns to add one first, once the README is known to be missing. Since dev a pasted web image is copied into the package. Both are detailed on the marketplace page.
  • Concurrent edits Since dev. The page sends the package’s update token with every draft and README save, so a save made from an older tab, or over someone else’s newer save, is refused (“This was changed in another tab or by someone else since you opened it…”) instead of overwriting it — see Stale saves are refused.
  • Versions. Create version is a button on this tab; the dialog closes once the version exists, because sending it for review is a separate decision. A version the store never received can be deleted; one that was sent for review or is installed somewhere is refused (VERSION_SENT, VERSION_INSTALLED). Deleting a version removes its record — the ZIP stays in storage — and its number is never reused. Compare versions also shows when the README was added, removed or updated. There is no Deprecate action (it only ever marked the version in this environment); Undo deprecation stays for versions already deprecated.
  • History sidebar. Created, edited (name, description, modules and pages added or removed, dependency ranges), README edited, versions created, deprecated, undeprecated and deleted, plus the review events — sent, approved, returned, store page listed or rejected.
  • Live reload. The page reloads when the platform pushes a packages/changed event for the open package (a review decision, for example), and again when the browser tab regains focus.
  • Global pages. Pages lists the package’s global pages — pages that belong to no module or entity. A package may hold only pages. A page that later moves into a module or entity cannot be published (PUBLISH_PAGE_NOT_GLOBAL), and neither can one that was installed or forked from another package.
  • Installed list (/admin/packages/installed): a Status select (Installed, Failed, Uninstalled) and a Source select beside the search and sort; both start empty, so every status and source shows. Installed includes failed and running installs, so a failed install appears under both Installed and Failed. A row with a live installation opens its installation page; an import record that has a live installation redirects there too.
  • Installation page (/admin/packages/installed/installations/{installationId}): source, origin, export time and result come from the newest import record behind the installation, with its README. History lists every install run (a failed run says so), plus fork and uninstall.
  • Failed installs offer retry from the import session while it exists, or uploading the same package file again, which takes the installation over. When a compatible newer version is available, Update is offered instead: it overwrites what the failed run created and installs the rest. A failed store install, or a stopped store update, also offers Report to publisher Since 1.10 (from 1.10.1) — see Reporting a failed install or update.
  • Fork asks for the package’s name to confirm, and is refused while other packages depend on the installation or an update is running. A forked installation’s resources show “Forked, so changes to these resources are no longer checked”. The page can render a Deleted tag for a resource removed after the fork, but the API reports such a resource as missing, so that tag does not appear yet.
  • Uninstall is offered on an active installation and on a forked one (the dialog warns that your own changes to forked resources are deleted with them). The button stays disabled until every link from outside the package is removed; the server enforces the same rule with 409 UNINSTALL_BLOCKED_BY_OUTSIDE_LINKS, so a call that skips the dialog is refused too. A stopped uninstall offers Retry.

Installed views and pages in their editors

Section titled “Installed views and pages in their editors”

A view or page installed by a package is locked by it. The settings, help and content panes are inert, and the save shortcut and Done are refused like the header Save; publishing or hiding a view stays available from the entity’s views list. Name, description and icon can still be changed (the editor shows the package’s value beside yours, your label is kept on every update, and an implicit view’s name stays read-only); the server rules are on Data views and Pages and widgets. Relation overrides stay usable (they are saved on the parent view), and script editors are read-only but selectable, so their code can still be read and copied.

GuardValueWhere
Max decompressed package200 MBMAX_DECOMPRESSED_SIZE
Max ZIP entries10 000MAX_ZIP_ENTRIES
Path-traversal / unsafe entriesrejectedisSafeEntryName, SAFE_PATH_COMPONENT
Persisted session error messagecapped 2 000 charsMAX_ERROR_MESSAGE_LENGTH
Session TTL7 daysimport-session.model.ts
Stuck-import recovery15 minutes in importingIMPORT_STUCK_THRESHOLD_MS
Export/import concurrencyBullMQ workers (Redis)EXPORT_QUEUE_NAME / IMPORT_QUEUE_NAME
Cancel-check cadenceevery 5 processed resourcesCANCEL_CHECK_INTERVAL

Implicit-child settle/poll timings are environment-overridable (PKG_IMPLICIT_SETTLE_MS, PKG_IMPLICIT_POLL_ATTEMPTS, PKG_IMPLICIT_POLL_DELAY_MS) — used so import can wait for data-service to spawn implicit views and queries asynchronously after an entity CREATE.

  • Hard edges only. Only hard references are guaranteed to travel with a package; soft references may be nulled on import — review the export analysis warnings and re-point them afterwards if needed. Since dev a page widget’s reference outside the package is offered for mapping at install (Page widgets pointing outside the package).
  • Function secrets do not travel Since dev. A packaged function carries its secret names only; set the values in each target environment (Function secrets stay in their environment).
  • Principal mapping rarely lines up by itself across environments — use mapping profiles and exact-match suggestions to map users and groups.
  • Cascade-skip on failure. One failed hard dependency skips its dependents. Fix the root cause and retry.
  • Templates need their fields. A template exported without its entity (or whose referenced fields or tokens are missing in the target) will fail to render after import.
  • Newer packages into older targets. The engine tolerates some version drift (for example, it synthesizes implicit child resources an older target does not auto-create), but a package built on a newer schema version than the target accepts is refused with an incompatible-schema error.
  • ValidationStatus is only NEW or EXISTING. A CONFLICT value is mentioned in a docstring and the web app has a Conflict label, but the current validation path never produces it — identity collisions are surfaced separately in the validation report.
  • Field-level wire DTOs are defined in the @osos/shared contracts and the controller spec builders; these pages document the verified fields and shapes, not every optional property of every wire DTO. packaging-service and dependency-service publish no OpenAPI description, so they do not appear in the generated endpoint reference.

Packaging is how your app resources travel between environments. OSOS also ships ready-made front-end plugin packages (custom plugins such as DIWAN, GATE and task-mgmt) that provide additional display components. These are distributed as an internal, in-app dynamic-component registry: each plugin package declares components (widgets/templates) that are lazy-loaded and registered internally so the app resolves them by name at runtime. Plugins are internal-only — there is no remote/federated loading — they ship bundled with the app build and are not fetched from an external source at runtime, and are added through the Generic View builder. This is distinct from the ZIP packaging flow above, which distributes environment resources rather than bundled code.

Note: The sample plugin scaffolds found in the plugins library are empty shells with no actual functionality — they are starting points for building your own plugin, not working components.

Related but distinct: module/entity JSON transfer

Section titled “Related but distinct: module/entity JSON transfer”

data-service also has an older, separate mechanism that exports and imports modules and entities as one JSON file. It is not the ZIP packaging system above and shares no code, format or endpoints with it; use packaging for a full app. Its format, endpoints and limits are in Module JSON transfer.

Platform 1.10.0 · Backend 1.11.0-alpha.11 · Frontend 1.11.0-alpha.6 · Mobile 1.10.2 · Chart 1.11.8 · Gateway 2.6.11 · MCP 0.2.0 · Grafana DS 1.2.0Docs build 2026-11-27