policy.feature-flag.apply ​
Upsert a module/workflow feature flag on/off for an app
Upsert a feature flag on/off for an app (GOV-7).
Inputs: actor, organization_uuid, identity_app_uuid, flag_key, enabled (required); flag_type ("module"|"workflow", default "module") and plan_tier (default "" = app-wide) optional. Idempotent: re-applying the same (app, flag_type, flag_key, plan_tier) updates the enabled bit. Outputs: flag_type, flag_key, plan_tier, enabled, created.
Overview ​
| Property | Value |
|---|---|
| Workflow type | Atomic |
| Library | App-policy |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
actor | string | Yes | — | — |
organization_uuid | uuid | Yes | — | — |
identity_app_uuid | uuid | Yes | — | — |
flag_key | string | Yes | — | — |
enabled | boolean | Yes | — | — |
flag_type | string | No | — | — |
plan_tier | string | No | — | — |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
flag_type | string | No | — | — |
flag_key | string | No | — | — |
plan_tier | string | No | — | — |
enabled | boolean | No | — | — |
created | boolean | No | — | — |
identity_app_uuid | uuid | No | — | — |
failure_reason | string | No | — | — |
failure_type | string | No | — | — |
failed_action | string | No | — | — |
failed_at_state | string | No | — | — |
failed_layer | string | No | — | — |
failed_step | string | No | — | — |
error | string | No | — | — |
error_type | string | No | — | — |
reason | string | No | — | — |
States ​
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
pending | Yes | No | — | execute | — |
completed | No | Yes | Yes | — | — |
failed | No | Yes | No | — | — |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
pending | execute | completed | — |
* (any state) | fail | failed | — |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "policy.feature-flag.apply",
"initial_data": {
"actor": "value",
"organization_uuid": "value",
"identity_app_uuid": "value",
"flag_key": "value"
}
}