Skip to main content

Lifecycle with Manual and Deploy Approval

This example combines lifecycle-owned manual approvals with environment-specific Deploy Approval requirements:

  1. registration enters BOOTSTRAPPED;
  2. an approved deployment in environment priority 1 moves it to DEPLOYED_IN_PREPROD and requests Governance approval;
  3. Governance approval moves it to GOVERNANCE_APPROVED;
  4. an approved deployment in environment priority 0 moves it to DEPLOYED_IN_PROD.

A Governance rejection moves the lifecycle to GOVERNANCE_REJECTED. A later successful pre-production deployment moves it back to DEPLOYED_IN_PREPROD and starts a new Governance approval.

The example assumes priority 1 is pre-production and priority 0 is production. Replace GOVERNANCE_TEAM with the exact RBAC role ID configured in the target installation.

schema: workflow.definition/v2

macroPhases:
nodes:
- { id: IMPLEMENTING, required: true, label: Implementing, icon: mui:Code }
- { id: OPERATING, required: true, label: Operating, icon: mui:Settings }
- { id: RETIRED, required: true, label: Retired, icon: mui:Clear }
edges:
- { from: IMPLEMENTING, to: OPERATING }
- { from: IMPLEMENTING, to: RETIRED }
- { from: OPERATING, to: RETIRED }
- { from: RETIRED, to: IMPLEMENTING }
- { from: RETIRED, to: OPERATING }

stages:
- name: BOOTSTRAPPED
initial: true
metadata:
{ macroPhase: IMPLEMENTING, label: Bootstrapped, description: System is registered and ready for pre-production deployment., icon: mui:Settings }
- name: DEPLOYED_IN_PREPROD
metadata:
{ macroPhase: IMPLEMENTING, label: Deployed in pre-production, description: System is deployed in pre-production and waiting for Governance approval., icon: mui:CloudDone }
- name: GOVERNANCE_APPROVED
metadata:
{ macroPhase: IMPLEMENTING, label: Governance approved, description: Governance approved the System for production deployment., icon: mui:CheckCircle }
- name: GOVERNANCE_REJECTED
metadata:
{ macroPhase: IMPLEMENTING, label: Governance rejected, description: Governance rejected production promotion and a new pre-production deployment is required., icon: mui:Cancel }
- name: DEPLOYED_IN_PROD
metadata:
{ macroPhase: OPERATING, label: Deployed in production, description: System is deployed in the production environment., icon: mui:CloudDone }
- name: RETIRED
metadata:
{ macroPhase: RETIRED, label: Retired, description: System is no longer active., icon: mui:Cancel }

transitions:
- id: enroll-system
from: null
to: BOOTSTRAPPED
metadata: { label: Enroll System }
trigger:
type: EVENT
metadata: { label: Register the System }
config:
eventTypes: [builder.system-registered]

- id: deployed-in-preprod-and-request-governance-approval
from: BOOTSTRAPPED
to: DEPLOYED_IN_PREPROD
metadata: { label: Deploy to pre-production and request Governance approval }
trigger:
type: EVENT
metadata: { label: Deploy to pre-production }
config:
eventTypes: [coordinator.system-provisioning-status-updated]
environmentPriority: 1
where: { eq: { path: payload.newStatus, value: DEPLOYED } }
preconditions:
- id: preprod-deploy-approval
type: WORKFLOW_RELATED
metadata: { label: Pre-production deployment approval is complete }
config:
workflowId: deploy-approval
state: DEPLOY_APPROVED
correlator: system-environment-v1
environmentPriority: 1
actions:
- type: MANUAL_APPROVAL
config:
approvalId: governance-approval
channels: [push]
approvers:
- strategy: rbac-role
recipient: GOVERNANCE_TEAM
scope:
anyOf: [entity, wildcard]
notifications:
request:
title: Governance approval requested for {{system.name}}
bodyHtml: |
<p>Review the pre-production deployment of
<strong>{{system.name}}</strong> before production promotion.</p>
approved:
title: Governance approved
bodyHtml: |
<p><strong>{{system.name}}</strong> was approved by
{{responder.displayName}}.</p>
rejected:
title: Governance rejected
bodyHtml: |
<p><strong>{{system.name}}</strong> was rejected by
{{responder.displayName}}.</p>

- id: governance-approved
from: DEPLOYED_IN_PREPROD
to: GOVERNANCE_APPROVED
metadata: { label: Governance approved }
trigger:
type: MANUAL_APPROVAL_RESPONSE
config: { approvalId: governance-approval, outcome: APPROVE }

- id: governance-rejected
from: DEPLOYED_IN_PREPROD
to: GOVERNANCE_REJECTED
metadata: { label: Governance rejected }
trigger:
type: MANUAL_APPROVAL_RESPONSE
config: { approvalId: governance-approval, outcome: REJECT }

- id: redeployed-in-preprod-and-request-governance-reapproval
from: GOVERNANCE_REJECTED
to: DEPLOYED_IN_PREPROD
metadata: { label: Redeploy to pre-production and request Governance approval }
trigger:
type: EVENT
metadata: { label: Redeploy to pre-production }
config:
eventTypes: [coordinator.system-provisioning-status-updated]
environmentPriority: 1
where: { eq: { path: payload.newStatus, value: DEPLOYED } }
preconditions:
- id: preprod-redeploy-approval
type: WORKFLOW_RELATED
metadata: { label: Pre-production redeployment approval is complete }
config:
workflowId: deploy-approval
state: DEPLOY_APPROVED
correlator: system-environment-v1
environmentPriority: 1
actions:
- type: MANUAL_APPROVAL
config:
approvalId: governance-reapproval
channels: [push]
approvers:
- strategy: rbac-role
recipient: GOVERNANCE_TEAM
scope:
anyOf: [entity, wildcard]
notifications:
request:
title: Governance reapproval requested for {{system.name}}
bodyHtml: |
<p>Review the new pre-production deployment of
<strong>{{system.name}}</strong> before production promotion.</p>
approved:
title: Governance reapproval granted
bodyHtml: |
<p><strong>{{system.name}}</strong> was approved by
{{responder.displayName}}.</p>
rejected:
title: Governance reapproval rejected
bodyHtml: |
<p><strong>{{system.name}}</strong> was rejected by
{{responder.displayName}}.</p>

- id: governance-reapproval-approved
from: DEPLOYED_IN_PREPROD
to: GOVERNANCE_APPROVED
metadata: { label: Governance reapproval granted }
trigger:
type: MANUAL_APPROVAL_RESPONSE
config: { approvalId: governance-reapproval, outcome: APPROVE }

- id: governance-reapproval-rejected
from: DEPLOYED_IN_PREPROD
to: GOVERNANCE_REJECTED
metadata: { label: Governance reapproval rejected }
trigger:
type: MANUAL_APPROVAL_RESPONSE
config: { approvalId: governance-reapproval, outcome: REJECT }

- id: production-deployed
from: GOVERNANCE_APPROVED
to: DEPLOYED_IN_PROD
metadata: { label: Deploy to production }
trigger:
type: EVENT
metadata: { label: Deploy to production }
config:
eventTypes: [coordinator.system-provisioning-status-updated]
environmentPriority: 0
where: { eq: { path: payload.newStatus, value: DEPLOYED } }
preconditions:
- id: production-deploy-approval
type: WORKFLOW_RELATED
metadata: { label: Production deployment approval is complete }
config:
workflowId: deploy-approval
state: DEPLOY_APPROVED
correlator: system-environment-v1
environmentPriority: 0

- id: preprod-undeployed-before-governance-response
from: DEPLOYED_IN_PREPROD
to: BOOTSTRAPPED
metadata: { label: Return to bootstrapped }
trigger:
type: EVENT
metadata: { label: Undeploy from pre-production }
config:
eventTypes: [coordinator.system-provisioning-status-updated]
environmentPriority: 1
where: { eq: { path: payload.newStatus, value: NOT_DEPLOYED } }

- id: preprod-undeployed-after-governance-approval
from: GOVERNANCE_APPROVED
to: BOOTSTRAPPED
metadata: { label: Return to bootstrapped }
trigger:
type: EVENT
metadata: { label: Undeploy from pre-production }
config:
eventTypes: [coordinator.system-provisioning-status-updated]
environmentPriority: 1
where: { eq: { path: payload.newStatus, value: NOT_DEPLOYED } }

- id: preprod-undeployed-after-governance-rejection
from: GOVERNANCE_REJECTED
to: BOOTSTRAPPED
metadata: { label: Return to bootstrapped }
trigger:
type: EVENT
metadata: { label: Undeploy from pre-production }
config:
eventTypes: [coordinator.system-provisioning-status-updated]
environmentPriority: 1
where: { eq: { path: payload.newStatus, value: NOT_DEPLOYED } }

- id: production-undeployed-preprod-deployed
from: DEPLOYED_IN_PROD
to: GOVERNANCE_APPROVED
metadata: { label: Return to Governance approved }
trigger:
type: EVENT
metadata: { label: Undeploy from production }
config:
eventTypes: [coordinator.system-provisioning-status-updated]
environmentPriority: 0
where: { eq: { path: payload.newStatus, value: NOT_DEPLOYED } }
when:
type: EXPRESSION
value: { eq: { path: deployment.priority.1.status, value: deployed } }

- id: production-undeployed-preprod-not-deployed
from: DEPLOYED_IN_PROD
to: BOOTSTRAPPED
metadata: { label: Return to bootstrapped }
trigger:
type: EVENT
metadata: { label: Undeploy from production }
config:
eventTypes: [coordinator.system-provisioning-status-updated]
environmentPriority: 0
where: { eq: { path: payload.newStatus, value: NOT_DEPLOYED } }
when:
type: EXPRESSION
value:
in:
path: deployment.priority.1.status
values: [not-deployed, partially-deployed, provisioning, corrupt]

- id: system-unregistered-from-bootstrapped
from: BOOTSTRAPPED
to: RETIRED
metadata: { label: Retire System }
trigger:
type: EVENT
metadata: { label: Unregister System }
config:
eventTypes: [builder.system-unregistered]

The Governance approval action runs after the pre-production deployment trigger and its Deploy Approval precondition pass. The transition then completes in DEPLOYED_IN_PREPROD, where the Governance response is expected.

Deploy Approval remains responsible for authorizing each environment-specific deployment. The Governance manual approval adds the promotion decision between pre-production and production; it does not replace the deployment approvals.

The first authorized Governance response wins. A rejection moves the lifecycle to GOVERNANCE_REJECTED, where it waits for another successful pre-production deployment event. That event evaluates the Deploy Approval precondition again, moves the lifecycle to DEPLOYED_IN_PREPROD, and starts a new Governance approval. An undeploy is not required between the rejected approval and the next deployment attempt.

The retry action uses governance-reapproval because action approvalId values must be unique within a workflow definition. Later redeployments can execute the same retry transition again: each occurrence creates a new approval execution.

The approver selectors accept both role assignments scoped to the current System and global assignments whose RBAC entity_ref is *. Remove wildcard when global role holders must not receive the request.