---
id: CAP-PFM-TNL-002
title: Open a workspace after its applications are ready
feature: FEAT-PFM-TNL-01
product_area: platform
module: tenant-lifecycle
revision: 2
status: draft
product_intent: proposed
implementation_evidence: observed
supersedes: []
source_sha:
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
intent_sources:
  - 'services-platform:docs/tenants/tenant-lifecycle-plan.md#§4.2'
  - 'services-platform:docs/tenants/tenant-lifecycle-plan.md#§4.5'
  - 'services-platform:docs/tenants/tenant-lifecycle-plan.md#§6.2'
purpose: >-
  The customer gains access after all planned application participants finish
  and pass readiness checks.
outcomes:
  - Participant construction follows dependency order.
  - A missing resource prevents opening and is identified for staff.
  - Opening preserves the requested business mode and records first activation.
concepts:
  - CON-PFM-TNL-002
  - CON-PFM-TNL-003
  - CON-PFM-TNL-001
actors:
  - ACT-PFM-012
surfaces:
  - job
preconditions: []
postconditions: []
permissions:
  - key: hq.tenants.provision
    where_checked: service
    scope: global
rules:
  - id: BR-CAP-PFM-TNL-002-01
    statement: >-
      The provisioning plan orders enabled participants by dependency, starting
      with the workspace record.
    kind: calculation
    enforced_at:
      - service
    must_prove: true
    provenance: test
    source: >-
      services-platform:modules/tenants/tests/unit/services/provisioning/provision-tenant-workflow.spec.js#runs
      the tenant row before anything that depends on it
    origin: >-
      services-platform:docs/tenants/tenant-lifecycle-plan.md#§6.2 (approved
      2026-10-09)
  - id: BR-CAP-PFM-TNL-002-02
    statement: >-
      A difference between the live participant order and the stored plan stops
      execution before participant work and reports both orders.
    kind: validation
    enforced_at:
      - service
    must_prove: true
    provenance: test
    source: >-
      services-platform:modules/tenants/tests/unit/services/provisioning/provision-tenant-workflow.spec.js#refuses
      a run whose participants are not the ones it was planned for, naming both
      plans
    origin: >-
      services-platform:docs/tenants/tenant-lifecycle-plan.md#§6.1 Registration
      (approved 2026-10-09)
  - id: BR-CAP-PFM-TNL-002-03
    statement: >-
      Each remote participant builds through its application’s lifecycle
      function; disabled or unreachable participants refuse the step.
    kind: policy
    enforced_at:
      - service
    must_prove: true
    provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/provisioning/provision-tenant.integration.spec.js#asks
      the other macroservice to provision each of its participants, for the
      tenant being provisioned
    origin: >-
      services-platform:docs/tenants/tenant-lifecycle-plan.md#§6.1 (approved
      2026-10-09)
  - id: BR-CAP-PFM-TNL-002-04
    statement: >-
      Readiness checks every planned participant and prevents opening when a
      participant reports missing resources.
    kind: validation
    enforced_at:
      - service
    must_prove: true
    provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/provisioning/provision-tenant.integration.spec.js#asks
      every participant to confirm what it made before the tenant is opened
    origin: >-
      services-platform:docs/tenants/tenant-lifecycle-plan.md#§4.5 (approved
      2026-10-09)
  - id: BR-CAP-PFM-TNL-002-05
    statement: >-
      Activation changes provisioning to active, preserves the first activation
      time and applies the requested business status; another activation has no
      further effect.
    kind: lifecycle
    enforced_at:
      - service
      - database
    must_prove: true
    provenance: test
    source: >-
      services-platform:modules/tenants/tests/e2e/tenant-provisioning.e2e.spec.js#records
      when the tenant became usable
    origin: >-
      services-platform:docs/tenants/tenant-lifecycle-plan.md#§4.5 (approved
      2026-10-09)
  - id: BR-CAP-PFM-TNL-002-06
    statement: >-
      Retry completes outstanding work while preserving completed participant
      steps.
    kind: invariant
    enforced_at:
      - service
    must_prove: true
    provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/provisioning/provision-tenant.integration.spec.js#does
      the missing work and not the finished work when it is provisioned again
    origin: >-
      services-platform:docs/tenants/tenant-lifecycle-plan.md#§4.4 (approved
      2026-10-09)
  - id: BR-CAP-PFM-TNL-002-07
    statement: Provisioning executes participants sequentially in dependency order.
    kind: policy
    enforced_at:
      - service
    must_prove: false
    provenance: observed
    source: >-
      services-platform:modules/tenants/services/provisioning/provision-tenant-workflow.ts
      (header, Sequential, not parallel)
    origin: none
  - id: BR-CAP-PFM-TNL-002-08
    statement: >-
      Activation enables always-available applications; failures establishing
      founding-staff access or development grants are logged, while
      application-enablement errors can fail the task.
    kind: policy
    enforced_at:
      - service
    must_prove: true
    provenance: observed
    source: >-
      services-platform:modules/tenants/services/provisioning/provision-tenant-operations.ts:activateOperation
    origin: none
  - id: BR-CAP-PFM-TNL-002-09
    statement: >-
      The provisioning execution allows seven days and retries transient task
      failures, while treating refusals as final for that attempt.
    kind: policy
    enforced_at:
      - service
    must_prove: false
    provenance: test
    source: >-
      services-platform:modules/tenants/tests/unit/services/provisioning/provision-tenant-workflow.spec.js#gives
      the execution a week, which is longer than one attempt of every task
      together
    origin: >-
      services-platform:docs/tenants/tenant-lifecycle-plan.md#§2.4 (approved
      2026-10-09)
scenarios:
  - id: SC-CAP-PFM-TNL-002-01
    given: 'The plan enables CRM, Accounting and Commerce participants.'
    when: Provisioning invokes the plan.
    then: 'Calls follow dependency order, including valid not-applicable responses.'
    provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/provisioning/provision-tenant.integration.spec.js#provisions
      accounting.configuration after the tenant row and accepts its
      not_applicable
  - id: SC-CAP-PFM-TNL-002-02
    given: Readiness finds a missing seed.
    when: The job attempts to open the workspace.
    then: The job reports the seed and leaves customer access closed.
    provenance: test
    source: >-
      services-platform:modules/tenants/tests/integration/services/provisioning/provision-tenant.integration.spec.js#leaves
      the tenant where an operator can see it, and does not open it
edge_cases: []
constraints: []
depends_on:
  - CAP-PFM-TNL-007
  - CAP-PFM-TNL-008
related:
  - CAP-PFM-TNL-001
  - CAP-PFM-TNL-003
  - CAP-PFM-TNL-006
journeys:
  - JNY-PFM-TNL-001
  - JNY-PFM-TNL-002
open_questions: []
evidence:
  - >-
    Inspected source:
    services-platform:docs/tenants/tenant-lifecycle-plan.md#§4.2
  - >-
    Inspected source:
    services-platform:docs/tenants/tenant-lifecycle-plan.md#§4.5
  - >-
    Inspected source:
    services-platform:docs/tenants/tenant-lifecycle-plan.md#§6.2
  - >-
    Inspected source:
    services-platform:modules/tenants/tests/unit/services/provisioning/provision-tenant-workflow.spec.js#runs
    the tenant row before anything that depends on it
  - >-
    Inspected source:
    services-platform:docs/tenants/tenant-lifecycle-plan.md#§6.2 (approved
    2026-10-09)
  - >-
    Inspected source:
    services-platform:modules/tenants/tests/unit/services/provisioning/provision-tenant-workflow.spec.js#refuses
    a run whose participants are not the ones it was planned for, naming both
    plans
  - >-
    Inspected source:
    services-platform:docs/tenants/tenant-lifecycle-plan.md#§6.1 Registration
    (approved 2026-10-09)
  - >-
    Inspected source:
    services-platform:modules/tenants/tests/integration/services/provisioning/provision-tenant.integration.spec.js#asks
    the other macroservice to provision each of its participants, for the tenant
    being provisioned
  - >-
    Inspected source:
    services-platform:docs/tenants/tenant-lifecycle-plan.md#§6.1 (approved
    2026-10-09)
  - >-
    Inspected source:
    services-platform:modules/tenants/tests/integration/services/provisioning/provision-tenant.integration.spec.js#asks
    every participant to confirm what it made before the tenant is opened
  - >-
    Inspected source:
    services-platform:docs/tenants/tenant-lifecycle-plan.md#§4.5 (approved
    2026-10-09)
  - >-
    Inspected source:
    services-platform:modules/tenants/tests/e2e/tenant-provisioning.e2e.spec.js#records
    when the tenant became usable
  - >-
    Inspected source:
    services-platform:modules/tenants/tests/integration/services/provisioning/provision-tenant.integration.spec.js#does
    the missing work and not the finished work when it is provisioned again
  - >-
    Inspected source:
    services-platform:docs/tenants/tenant-lifecycle-plan.md#§4.4 (approved
    2026-10-09)
  - >-
    Inspected source:
    services-platform:modules/tenants/services/provisioning/provision-tenant-workflow.ts
    (header, Sequential, not parallel)
  - >-
    Inspected source:
    services-platform:modules/tenants/services/provisioning/provision-tenant-operations.ts:activateOperation
  - >-
    Inspected source:
    services-platform:modules/tenants/tests/unit/services/provisioning/provision-tenant-workflow.spec.js#gives
    the execution a week, which is longer than one attempt of every task
    together
  - >-
    Inspected source:
    services-platform:docs/tenants/tenant-lifecycle-plan.md#§2.4 (approved
    2026-10-09)
  - >-
    Inspected source:
    services-platform:modules/tenants/tests/integration/services/provisioning/provision-tenant.integration.spec.js#provisions
    accounting.configuration after the tenant row and accepts its not_applicable
  - >-
    Inspected source:
    services-platform:modules/tenants/tests/integration/services/provisioning/provision-tenant.integration.spec.js#leaves
    the tenant where an operator can see it, and does not open it
controls: [TC-AVL-001, TC-AVL-004, TC-AZ-001, TC-AZ-002, TC-AZ-003, TC-AZ-004, TC-AZ-005, TC-IAM-003, TC-LOG-001, TC-LOG-004, TC-LOG-005, TC-MON-001, TC-PI-001, TC-PI-002, TC-PI-003, TC-PI-004, TC-PI-005, TC-TEN-001, TC-TEN-002, TC-TEN-003, TC-VEN-001, TC-VEN-002, TC-VEN-003]
---

# Open a workspace after its applications are ready

## Purpose

The customer gains access after all planned application participants finish and pass readiness checks.

## How It Works

Platform derives a build plan from enabled participant declarations. It compares that plan with the participants described by the applications. A changed order or participant list stops the job with the difference reported. Each participant then builds its own resources in sequence. Completed steps are carried into a retry rather than invoked again. Readiness asks every planned participant to account for its resources. A missing item leaves the workspace closed and the build failed. Successful readiness permits activation in the requested business mode. Activation also establishes application and staff-access housekeeping, with different failure handling for those writes.

## Relationships

- Account for each application’s lifecycle responsibilities: The provisioning request records the job and its opening choices.
- Apply defaults without undoing customer choices: Registration supplies the dependency plan.
- Request a complete customer workspace: The capabilities share the workspace’s recorded lifecycle decision.
- Understand and recover a workspace build: Its snapshots and recovery explain interrupted construction.
- Preserve valid workspace lifecycle states: The capabilities share the workspace’s recorded lifecycle decision.
