Skip to content
Proud to collaborate with Microsoft for Startups

data.ai-provider.persist ​

Create or update an AIProviderConfig linking a CloudConnection to AI-specific settings

Persist an AIProviderConfig: create new or update existing row.

Input: organization_uuid, connection_uuid, default_model, plus optional model_config, rate_limit_rpm, rate_limit_tpm, is_default, actor. Output in state_data: ai_provider_config_uuid, persisted, created, persisted_at.

Idempotency key: (organization_id, connection_id). A second call with the same pair updates the row in place; no duplicate is inserted.

Overview ​

PropertyValue
Workflow typeAtomic
LibraryApp-connection
Version1.0

Input Schema ​

FieldTypeRequiredDefaultDescription
organization_uuiduuidYes—UUID of the organization that owns the AI provider config
connection_uuiduuidYes—UUID of the CloudConnection being attached as 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 dict: temperature, max_tokens, etc.
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 organization
actorstringNo—Caller identity (Cognito sub or UUID) initiating the persist

Output Schema ​

FieldTypeRequiredDefaultDescription
ai_provider_config_uuiduuidYes—UUID of the persisted AIProviderConfig row
persistedbooleanYes—True when a row was created or updated in this run
createdbooleanYes—True when a new row was inserted (False when updating existing)
persisted_atstringYes—ISO-8601 timestamp of the persist operation
failure_reasonstringNo—Engine-stamped: human-readable failure reason
failure_typestringNo—Engine-stamped: failure category
failed_actionstringNo—Engine-stamped: action method that raised
failed_at_statestringNo—Engine-stamped: state name when the failure occurred
failed_stepstringNo—Engine-stamped: name of the step that failed (DAG workflows)
failed_layerintegerNo—Engine-stamped: layer index that failed (DAG workflows)
errorstringNo—Engine-stamped: error message on the failure envelope
error_typestringNo—Engine-stamped: exception class name on the failure envelope

States ​

StateInitialTerminalSuccessAuto-advanceDescription
pendingYesNo—completePersist AI provider config
completedNoYesYes—Persisted
failedNoYesNo—Persist failed

State Diagram ​

Transitions ​

FromActionToDescription
pendingcompletecompleted—
pendingfailfailed—

API Usage ​

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

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