identity.end-user.organization.switch ​
Set the current end-user's active workspace
Set the CURRENT end-user's active workspace.
Principal is the injected end-user token (never input). Input: app_organization_uuid. Validates the end-user is an ACTIVE member of the target workspace and fails closed otherwise, then writes EndUserAppGrant.active_app_organization_id. Outputs: app_organization_ref, active_app_organization_uuid, membership_status.
Overview ​
| Property | Value |
|---|---|
| Workflow type | Atomic |
| Library | App-identity |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
app_organization_uuid | uuid | Yes | — | — |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
app_organization_ref | dict | No | — | — |
active_app_organization_uuid | uuid | No | — | — |
membership_status | string | No | — | — |
failure_reason | string | No | — | — |
failure_type | string | No | — | — |
failed_action | string | No | — | — |
failed_at_state | 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": "identity.end-user.organization.switch",
"initial_data": {
"app_organization_uuid": "value"
}
}