ai-provider.enable ​
Enables an AI provider configuration (sets enabled=True). Refuses to enable a config whose cloud connection is missing or soft-deleted (orphaned config). Idempotent: already-enabled configs complete with enabled=False and no DB mutation. Counterpart of ai-provider.disable.
Workflow for enabling 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 enable |
actor | string | No | — | Actor initiating the enable (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 enable |
enabled | boolean | No | — | True if state changed from disabled to enabled; False if already enabled |
default_model | string | No | — | The config's default model, echoed for confirmation |
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 | Enable request received; executing immediately |
completed | No | Yes | Yes | — | AI provider config enabled (or was already enabled) |
failed | No | Yes | No | — | Enable 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_ENABLE_ORPHANED_CONFIG | Cannot enable AI provider config {config_uuid}: its cloud connection is {connection_state}. Recreate the provider config against a live connection (ai-provider.setup) and delete this row (ai-provider.delete). |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "ai-provider.enable",
"initial_data": {
"organization_uuid": "value",
"ai_provider_config_uuid": "value"
}
}