data.identity.membership.persist ​
Idempotently create or restore an OrganizationUser row
Persist an OrganizationUser membership: create, restore, or return existing.
Input: organization_uuid + user_uuid (required), role, invited_by_uuid (optional). Output in state_data: membership_uuid, persisted, restored, persisted_at.
Overview ​
| Property | Value |
|---|---|
| Workflow type | Atomic |
| Library | App-identity |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
user_uuid | uuid | Yes | — | — |
organization_uuid | uuid | Yes | — | For tenant verification |
role | string | No | — | — |
invited_by_uuid | uuid | No | — | — |
actor | string | No | — | — |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
membership_uuid | uuid | Yes | — | — |
persisted | boolean | Yes | — | — |
restored | boolean | Yes | — | — |
persisted_at | string | Yes | — | — |
actor | string | No | — | — |
invited_by_uuid | uuid | No | — | — |
organization_uuid | uuid | No | — | — |
role | string | No | — | — |
user_uuid | uuid | No | — | — |
failure_reason | string | No | — | — |
failure_type | string | No | — | — |
failed_action | string | No | — | — |
failed_at_state | string | No | — | — |
failed_step | string | No | — | — |
failed_layer | string | No | — | — |
error | string | No | — | — |
error_type | string | No | — | — |
States ​
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
pending | Yes | No | — | complete | Persist membership |
completed | No | Yes | Yes | — | Persisted |
failed | No | Yes | No | — | Persist failed |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
pending | complete | completed | — |
pending | fail | failed | — |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "data.identity.membership.persist",
"initial_data": {
"user_uuid": "value",
"organization_uuid": "value"
}
}