ai-provider.delete
Permanently deletes an AI provider configuration. Refuses to delete an enabled config — disable it first (the DB guarantees the org default is always enabled, so the default is transitively protected). Built for cleaning up configs orphaned by connection soft-delete.
Workflow for permanently deleting an AIProviderConfig.
States: pending (initial, auto_advance="execute") → completed / failed any → failed
Overview
| Property | Value |
|---|---|
| Workflow type | Atomic |
| Library | App-connection |
| Version | 1.0 |
Input Schema
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | uuid | Yes | — | UUID of the organization that owns the config |
ai_provider_config_uuid | uuid | Yes | — | UUID of the AIProviderConfig to delete permanently |
actor | string | No | — | Actor initiating the delete (for audit) |
Output Schema
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | uuid | No | — | Organization UUID echoed from input |
ai_provider_config_uuid | uuid | No | — | AI provider config UUID echoed from input |
actor | string | No | — | Actor that initiated the delete |
deleted | boolean | No | — | True when the row was deleted in this run |
default_model | string | No | — | The deleted config's default model, echoed for the audit trail |
was_orphaned | boolean | No | — | True when the config's cloud connection was missing or soft-deleted |
completed_at | string | No | — | ISO-8601 timestamp of completion |
failure_reason | string | No | — | Engine-stamped human-readable failure reason |
failed_at_state | string | No | — | Engine-stamped state name when the workflow failed |
failed_step | string | No | — | Engine-stamped step name (DAG path; None for atomic workflows) |
failed_layer | integer | No | — | Engine-stamped layer index (DAG path; None for atomic workflows) |
error | string | No | — | Engine-stamped exception message |
error_type | string | No | — | Engine-stamped exception class name |
failure_type | string | No | — | Failure category |
failed_action | string | No | — | Action method that raised |
failed_at | string | No | — | ISO-8601 timestamp of failure |
States
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
pending | Yes | No | — | execute | Delete request received; executing immediately |
completed | No | Yes | Yes | — | AI provider config deleted |
failed | No | Yes | No | — | Delete workflow failed |
State Diagram
Transitions
| From | Action | To | Description |
|---|---|---|---|
pending | execute | completed | — |
* (any state) | fail | failed | — |
Business Errors
| Code | Message Template |
|---|---|
AI_PROVIDER_CONFIG_NOT_FOUND | AI provider config {config_uuid} not found in organization |
CANNOT_DELETE_ENABLED_CONFIG | Cannot delete AI provider config {config_uuid}: it is enabled. Disable it first (ai-provider.disable). |
API Usage
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "ai-provider.delete",
"initial_data": {
"organization_uuid": "value",
"ai_provider_config_uuid": "value"
}
}