Skip to content
Proud to collaborate with Microsoft for Startups

ai-provider.setup ​

Attach a CloudConnection to an organisation as an AI provider configuration, validating AI-capability and persisting via data.ai-provider.persist

Attach a CloudConnection to an organisation as an AI provider configuration.

Validates that the connection exists, is active, and belongs to an AI-capable provider type, then delegates persistence to data.ai-provider.persist via engine.run_sync.

States: PENDING (initial) → COMPLETED | FAILED

Overview ​

PropertyValue
Workflow typeAtomic
LibraryApp-connection
Version1.0

Input Schema ​

FieldTypeRequiredDefaultDescription
organization_uuiduuidYes—UUID of the organisation that will own the AI provider config
connection_uuiduuidYes—UUID of the CloudConnection to attach as an AI provider
default_modelstringYes—Default model ID (e.g. 'gpt-4o-mini', 'MiniMax-M2')
modelslistNo—User-supplied list of model IDs (e.g. for OpenRouter); null leaves it unset
model_configdictNo—Model configuration: temperature, max_tokens, etc.
agent_capacitydictNo—Typed coding-session reservation with positive session_rpm and session_tpm; requires provider rate_limit_rpm and rate_limit_tpm
rate_limit_rpmintegerNo—Requests-per-minute rate limit; null means unlimited
rate_limit_tpmintegerNo—Tokens-per-minute rate limit; null means unlimited
is_defaultbooleanNo—Mark as the default AI provider for this organisation
actorstringNo—Authenticated caller (Cognito sub or UUID) initiating this setup

Output Schema ​

FieldTypeRequiredDefaultDescription
organization_uuiduuidYes—UUID of the organisation that will own the AI provider config
connection_uuiduuidYes—UUID of the CloudConnection to attach as an AI provider
default_modelstringYes—Default model ID (e.g. 'gpt-4o-mini', 'MiniMax-M2')
modelslistNo—User-supplied list of model IDs (e.g. for OpenRouter); null leaves it unset
model_configdictNo—Model configuration: temperature, max_tokens, etc.
agent_capacitydictNo—Typed coding-session reservation with positive session_rpm and session_tpm; requires provider rate_limit_rpm and rate_limit_tpm
rate_limit_rpmintegerNo—Requests-per-minute rate limit; null means unlimited
rate_limit_tpmintegerNo—Tokens-per-minute rate limit; null means unlimited
is_defaultbooleanNo—Mark as the default AI provider for this organisation
actorstringNo—Authenticated caller (Cognito sub or UUID) initiating this setup
ai_provider_config_uuiduuidNo—UUID of the persisted AIProviderConfig row
createdbooleanNo—True when a new AIProviderConfig row was inserted
completed_atstringNo—ISO-8601 timestamp of successful completion
failure_reasonstringNo—Controlled-vocabulary failure reason
failure_typestringNo—Failure category
failed_actionstringNo—Action method that raised
failed_at_statestringNo—State the workflow was in when it failed
failed_atstringNo—ISO-8601 timestamp of failure
errorstringNo—Engine-stamped error message on the failure path
error_typestringNo—Engine-stamped error type on the failure path
failed_layerstringNo—Engine-stamped DAG layer name on the failure path
failed_stepstringNo—Engine-stamped DAG step name on the failure path

States ​

StateInitialTerminalSuccessAuto-advanceDescription
pendingYesNo—executeAI provider setup request received; validating and persisting
completedNoYesYes—AI provider configuration created or updated successfully
failedNoYesNo—AI provider setup failed

State Diagram ​

Transitions ​

FromActionToDescription
pendingexecutecompleted—
* (any state)failfailed—

Business Errors ​

CodeMessage Template
CONNECTION_NOT_FOUNDCloudConnection {connection_uuid} not found for this organisation
CONNECTION_NOT_ACTIVECloudConnection {connection_uuid} is not active
CONNECTION_NOT_AI_PROVIDERCloudConnection {connection_uuid} (type={connection_type}) is not an AI-capable provider
INVALID_CONFIG

API Usage ​

bash
POST /api/workflows/start
Content-Type: application/json

{
  "workflow_type": "ai-provider.setup",
  "initial_data": {
    "organization_uuid": "value",
    "connection_uuid": "value",
    "default_model": "value"
  }
}