ai-provider.disable
Disables an AI provider configuration (sets enabled=False). Refuses to disable the last enabled default — caller must promote another config first. Idempotent: already-disabled configs complete with disabled=False and no DB mutation.
Workflow for disabling 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 disable |
actor | string | No | — | Actor initiating the disable (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 disable |
was_default | boolean | No | — | True if this config was the org default before disable |
disabled | boolean | No | — | True if state changed from enabled to disabled; False if already disabled |
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 | Disable request received; executing immediately |
completed | No | Yes | Yes | — | AI provider config disabled (or was already disabled) |
failed | No | Yes | No | — | Disable 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_DISABLE_LAST_DEFAULT | Cannot disable AI provider config {config_uuid}: it is the only enabled default for this organization. Promote another config first. |
API Usage
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "ai-provider.disable",
"initial_data": {
"organization_uuid": "value",
"ai_provider_config_uuid": "value"
}
}