data.identity.notification-pref.persist ​
Create or restore a UserNotificationPreference row
Persist a UserNotificationPreference record: create new, restore soft-deleted, or return the existing active row.
Input: user_uuid + organization_uuid + organization_uuid (required), optional channel/quiet-hours settings, optional actor. Output in state_data: preference_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 | — | — |
in_app_enabled | boolean | No | — | — |
email_enabled | boolean | No | — | — |
email_digest | string | No | — | — |
quiet_hours_enabled | boolean | No | — | — |
quiet_hours_start | string | No | — | — |
quiet_hours_end | string | No | — | — |
quiet_hours_timezone | string | No | — | — |
actor | string | No | — | — |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
preference_uuid | string | Yes | — | — |
persisted | boolean | Yes | — | — |
restored | boolean | Yes | — | — |
persisted_at | string | Yes | — | — |
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 notification preference |
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.notification-pref.persist",
"initial_data": {
"user_uuid": "value",
"organization_uuid": "value"
}
}