Deployment Configuration Guide
This guide covers creating and managing deployment configurations using the WIIL Platform JS SDK. Deployment configurations are the central composition entity that brings together agents, instructions, channels, and projects to create complete AI deployments.
Quick Start​
- TypeScript
- Python
import { WiilClient, DeploymentType, BusinessSupportServices } from 'wiil-js';
const client = new WiilClient({
apiKey: 'your-api-key',
});
// Assuming you have already created:
// - A project
// - An instruction configuration
// - An agent configuration
// - A deployment channel
const deployment = await client.deploymentConfigs.create({
projectId: 'proj_123',
deploymentChannelId: 'channel_456',
agentConfigurationId: 'agent_789',
instructionConfigurationId: 'instr_abc',
deploymentName: 'Customer Support Deployment',
});
console.log('Deployment created:', deployment.id);
from wiil import WiilClient
from wiil.models.service_mgt import CreateDeploymentConfiguration
client = WiilClient(api_key='your-api-key')
# Assuming you have already created:
# - A project
# - An instruction configuration
# - An agent configuration
# - A deployment channel
deployment = client.deployment_configs.create(
CreateDeploymentConfiguration(
project_id='proj_123',
deployment_channel_id='channel_456',
agent_configuration_id='agent_789',
instruction_configuration_id='instr_abc',
deployment_name='Customer Support Deployment',
)
)
print(f'Deployment created: {deployment.id}')
Architecture Overview​
Deployment configurations are the central composition entity in the WIIL platform:
- Brings Together: Agent Configuration + Instruction Configuration + Deployment Channel + Project
- 1:1 with Channel: Each deployment has exactly one channel
- N:1 Relationships: Multiple deployments can share agents, instructions, and projects
- Multi-Channel Pattern: Create separate deployments for each channel to expose an agent through multiple channels
Provisioning Types:
- DIRECT: Agent processes interactions directly
- CHAINED: Uses provisioning chain (STT -> Agent -> TTS) for voice processing
Enums​
DeploymentStatus​
- TypeScript
- Python
enum DeploymentStatus {
PENDING = 'pending', // Created but not yet activated
ACTIVE = 'active', // Operational and accepting interactions
PAUSED = 'paused', // Temporarily suspended
ARCHIVED = 'archived' // Decommissioned
}
from wiil.models.type_definitions import DeploymentStatus
# Available values:
DeploymentStatus.PENDING # 'pending' - Created but not yet activated
DeploymentStatus.ACTIVE # 'active' - Operational and accepting interactions
DeploymentStatus.PAUSED # 'paused' - Temporarily suspended
DeploymentStatus.ARCHIVED # 'archived' - Decommissioned
DeploymentProvisioningType​
- TypeScript
- Python
enum DeploymentProvisioningType {
DIRECT = 'direct', // Direct agent processing
CHAINED = 'chained' // Provisioning chain (STT -> Agent -> TTS)
}
from wiil.models.type_definitions import DeploymentProvisioningType
# Available values:
DeploymentProvisioningType.DIRECT # 'direct' - Direct agent processing
DeploymentProvisioningType.CHAINED # 'chained' - Provisioning chain (STT -> Processing -> TTS)
Deployment Configuration Schema​
| Field | Type | Required | Description |
|---|---|---|---|
| projectId | string | Yes | Project this deployment belongs to |
| deploymentChannelId | string | Yes | Deployment channel ID (1:1 relationship) |
| agentConfigurationId | string | Yes | Agent configuration ID (N:1 relationship) |
| instructionConfigurationId | string | Yes | Instruction configuration ID (N:1 relationship) |
| deploymentName | string | No | Human-readable name |
| deploymentStatus | DeploymentStatus | Auto | Current status (defaults to PENDING) |
| provisioningType | DeploymentProvisioningType | No | Processing type (default: DIRECT) |
| provisioningConfigChainId | string | No | Chain ID (required for CHAINED type) |
| isActive | boolean | No | Whether accepting interactions (default: false) |
CRUD Operations​
Create Deployment Configuration​
- TypeScript
- Python
// Get or create prerequisites
const model = await client.supportModels.getDefaultMultiMode();
const instruction = await client.instructionConfigs.create({
instructionName: 'Support Instructions',
role: 'Support Agent',
introductionMessage: 'Hello!',
instructions: 'You are a helpful support agent.',
guardrails: 'Be professional.',
supportedServices: [BusinessSupportServices.APPOINTMENT_MANAGEMENT],
});
const agent = await client.agentConfigs.create({
name: 'SupportBot',
modelId: model!.modelId,
instructionConfigurationId: instruction.id,
});
const channel = await client.deploymentChannels.create({
channelIdentifier: 'https://support.example.com',
deploymentType: DeploymentType.WEB,
channelName: 'Support Chat',
recordingEnabled: true,
configuration: { communicationType: 'unified' },
});
// Get project
const projects = await client.projects.list();
const projectId = projects.data[0].id;
// Create deployment
const deployment = await client.deploymentConfigs.create({
projectId: projectId,
deploymentChannelId: channel.id,
agentConfigurationId: agent.id,
instructionConfigurationId: instruction.id,
deploymentName: 'Customer Support',
});
console.log('Deployment created:', deployment.id);
console.log('Status:', deployment.deploymentStatus);
import time
from wiil import WiilClient
from wiil.models.service_mgt import (
CreateDeploymentConfiguration,
CreateAgentConfiguration,
CreateInstructionConfiguration,
CreateDeploymentChannel,
)
from wiil.models.type_definitions import DeploymentType, BusinessSupportServices
client = WiilClient(api_key='your-api-key')
# Get or create prerequisites
models = client.support_models.list()
model = next(
(m for m in models if m.type == 'multi_mode' and not m.discontinued),
None
)
instruction = client.instruction_configs.create(
CreateInstructionConfiguration(
instruction_name='Support Instructions',
role='Support Agent',
introduction_message='Hello!',
instructions='You are a helpful support agent.',
guardrails='Be professional.',
supported_services=[BusinessSupportServices.APPOINTMENT_MANAGEMENT],
)
)
agent = client.agent_configs.create(
CreateAgentConfiguration(
name='SupportBot',
model_id=model.model_id,
instruction_configuration_id=instruction.id,
)
)
timestamp = int(time.time())
channel = client.deployment_channels.create(
CreateDeploymentChannel(
channel_identifier=f'https://support-{timestamp}.example.com',
deployment_type=DeploymentType.WEB.value,
channel_name='Support Chat',
recording_enabled=True,
configuration={'communicationType': 'unified'},
)
)
# Get project
projects = client.projects.list()
project_id = projects.data[0].id
# Create deployment
deployment = client.deployment_configs.create(
CreateDeploymentConfiguration(
project_id=project_id,
deployment_channel_id=channel.id,
agent_configuration_id=agent.id,
instruction_configuration_id=instruction.id,
deployment_name='Customer Support',
)
)
print(f'Deployment created: {deployment.id}')
print(f'Status: {deployment.deployment_status}')
Create Chained Deployment​
For voice deployments with STT/TTS processing:
- TypeScript
- Python
const chainedDeployment = await client.deploymentConfigs.createChain({
projectId: 'proj_123',
deploymentChannelId: 'channel_456',
agentConfigurationId: 'agent_789',
instructionConfigurationId: 'instr_abc',
provisioningConfigChainId: 'chain_xyz',
deploymentName: 'Voice Support Line',
});
from wiil.models.service_mgt import CreateDeploymentConfiguration
chained_deployment = client.deployment_configs.create_chain(
CreateDeploymentConfiguration(
project_id='proj_123',
deployment_channel_id='channel_456',
agent_configuration_id='agent_789',
instruction_configuration_id='instr_abc',
provisioning_config_chain_id='chain_xyz',
deployment_name='Voice Support Line',
)
)
Get Deployment Configuration​
- TypeScript
- Python
// Get by ID
const deployment = await client.deploymentConfigs.get('deploy_123');
console.log('Deployment name:', deployment.deploymentName);
console.log('Status:', deployment.deploymentStatus);
console.log('Active:', deployment.isActive);
// Get by channel ID
const byChannel = await client.deploymentConfigs.getByChannel('channel_456');
console.log('Deployment for channel:', byChannel.id);
# Get by ID
deployment = client.deployment_configs.get('deploy_123')
print(f'Deployment name: {deployment.deployment_name}')
print(f'Status: {deployment.deployment_status}')
print(f'Active: {deployment.is_active}')
# Get by channel ID
by_channel = client.deployment_configs.get_by_channel('channel_456')
print(f'Deployment for channel: {by_channel.id}')
List Deployment Configurations​
- TypeScript
- Python
// List all deployments
const result = await client.deploymentConfigs.list({
page: 1,
pageSize: 20,
});
console.log('Total deployments:', result.meta.totalCount);
result.data.forEach(d => {
console.log(`- ${d.deploymentName} (${d.deploymentStatus})`);
});
// List by project
const projectDeployments = await client.deploymentConfigs.listByProject('proj_123');
console.log('Project deployments:', projectDeployments.data.length);
// List by agent
const agentDeployments = await client.deploymentConfigs.listByAgent('agent_789');
console.log('Agent deployments:', agentDeployments.data.length);
// List by instruction
const instrDeployments = await client.deploymentConfigs.listByInstruction('instr_abc');
console.log('Instruction deployments:', instrDeployments.data.length);
from wiil.types import PaginationRequest
# List all deployments
result = client.deployment_configs.list(
params=PaginationRequest(page=1, page_size=20)
)
print(f'Total deployments: {result.meta.total_count}')
for d in result.data:
print(f'- {d.deployment_name} ({d.deployment_status})')
# List by project
project_deployments = client.deployment_configs.list_by_project('proj_123')
print(f'Project deployments: {len(project_deployments.data)}')
# List by agent
agent_deployments = client.deployment_configs.list_by_agent('agent_789')
print(f'Agent deployments: {len(agent_deployments.data)}')
# List by instruction
instr_deployments = client.deployment_configs.list_by_instruction('instr_abc')
print(f'Instruction deployments: {len(instr_deployments.data)}')
Update Deployment Configuration​
- TypeScript
- Python
const updated = await client.deploymentConfigs.update({
id: 'deploy_123',
deploymentName: 'Updated Support Deployment',
isActive: true,
});
console.log('Updated name:', updated.deploymentName);
console.log('Now active:', updated.isActive);
from wiil.models.service_mgt import UpdateDeploymentConfiguration
updated = client.deployment_configs.update(
UpdateDeploymentConfiguration(
id='deploy_123',
deployment_name='Updated Support Deployment',
is_active=True,
)
)
print(f'Updated name: {updated.deployment_name}')
print(f'Now active: {updated.is_active}')
Delete Deployment Configuration​
- TypeScript
- Python
const deleted = await client.deploymentConfigs.delete('deploy_123');
if (deleted) {
console.log('Deployment deleted successfully');
}
deleted = client.deployment_configs.delete('deploy_123')
if deleted:
print('Deployment deleted successfully')
Complete Example​
Full workflow demonstrating deployment configuration lifecycle:
- TypeScript
- Python
import { WiilClient, DeploymentType, BusinessSupportServices } from 'wiil-js';
const client = new WiilClient({
apiKey: process.env.WIIL_API_KEY!,
});
async function createFullDeployment() {
// 1. Get model
const model = await client.supportModels.getDefaultMultiMode();
if (!model) throw new Error('No model available');
console.log('Using model:', model.modelId);
// 2. Get or create project
const projects = await client.projects.list();
let projectId: string;
if (projects.data.length > 0) {
projectId = projects.data[0].id;
} else {
const project = await client.projects.create({
name: 'Test Project',
description: 'Integration test project',
});
projectId = project.id;
}
console.log('Using project:', projectId);
// 3. Create instruction configuration
const instruction = await client.instructionConfigs.create({
instructionName: `Deployment_Test_Instructions_${Date.now()}`,
role: 'Deployment Test Agent',
introductionMessage: 'Hello! I am a test deployment agent.',
instructions: 'You are a helpful assistant for deployment testing.',
guardrails: 'Follow all safety guidelines.',
supportedServices: [BusinessSupportServices.APPOINTMENT_MANAGEMENT],
});
console.log('Instruction created:', instruction.id);
// 4. Create agent configuration
const agent = await client.agentConfigs.create({
name: 'DeployTestAgent',
modelId: model.modelId,
instructionConfigurationId: instruction.id,
metadata: { test: true },
});
console.log('Agent created:', agent.id);
// 5. Create deployment channel
const channel = await client.deploymentChannels.create({
channelIdentifier: `https://test-deploy-${Date.now()}.example.com`,
deploymentType: DeploymentType.WEB,
channelName: 'Test Deployment Channel',
recordingEnabled: true,
configuration: { communicationType: 'unified' },
});
console.log('Channel created:', channel.id);
// 6. Create deployment configuration
const deployment = await client.deploymentConfigs.create({
projectId: projectId,
deploymentChannelId: channel.id,
agentConfigurationId: agent.id,
instructionConfigurationId: instruction.id,
deploymentName: `Test_Deployment_${Date.now()}`,
});
console.log('Deployment created:', deployment.id);
console.log('Status:', deployment.deploymentStatus);
// 7. Retrieve deployment
const retrieved = await client.deploymentConfigs.get(deployment.id);
console.log('Retrieved deployment:', retrieved.deploymentName);
// 8. List deployments by project
const projectDeployments = await client.deploymentConfigs.listByProject(projectId);
console.log('Project has', projectDeployments.data.length, 'deployments');
// 9. Update deployment
const updated = await client.deploymentConfigs.update({
id: deployment.id,
deploymentName: 'Updated_Test_Deployment',
});
console.log('Updated name:', updated.deploymentName);
// 10. Clean up (in reverse order of dependencies)
await client.deploymentConfigs.delete(deployment.id);
console.log('Deployment deleted');
await client.deploymentChannels.delete(channel.id);
console.log('Channel deleted');
await client.agentConfigs.delete(agent.id);
console.log('Agent deleted');
await client.instructionConfigs.delete(instruction.id);
console.log('Instruction deleted');
console.log('Cleanup complete!');
}
createFullDeployment().catch(console.error);
import os
import time
from wiil import WiilClient
from wiil.models.service_mgt import (
CreateDeploymentConfiguration,
CreateAgentConfiguration,
CreateInstructionConfiguration,
CreateDeploymentChannel,
UpdateDeploymentConfiguration,
)
from wiil.models.type_definitions import DeploymentType, BusinessSupportServices
client = WiilClient(api_key=os.environ['WIIL_API_KEY'])
def create_full_deployment():
# 1. Get model
models = client.support_models.list()
model = next(
(m for m in models if m.type == 'multi_mode' and not m.discontinued),
None
)
if not model:
raise ValueError('No model available')
print(f'Using model: {model.model_id}')
# 2. Get or create project
projects = client.projects.list()
if projects.data:
project_id = projects.data[0].id
else:
project = client.projects.create(
name='Test Project',
description='Integration test project',
)
project_id = project.id
print(f'Using project: {project_id}')
timestamp = int(time.time())
# 3. Create instruction configuration
instruction = client.instruction_configs.create(
CreateInstructionConfiguration(
instruction_name=f'Deployment_Test_Instructions_{timestamp}',
role='Deployment Test Agent',
introduction_message='Hello! I am a test deployment agent.',
instructions='You are a helpful assistant for deployment testing.',
guardrails='Follow all safety guidelines.',
supported_services=[BusinessSupportServices.APPOINTMENT_MANAGEMENT],
)
)
print(f'Instruction created: {instruction.id}')
# 4. Create agent configuration
agent = client.agent_configs.create(
CreateAgentConfiguration(
name='DeployTestAgent',
model_id=model.model_id,
instruction_configuration_id=instruction.id,
metadata={'test': True},
)
)
print(f'Agent created: {agent.id}')
# 5. Create deployment channel
channel = client.deployment_channels.create(
CreateDeploymentChannel(
channel_identifier=f'https://test-deploy-{timestamp}.example.com',
deployment_type=DeploymentType.WEB.value,
channel_name='Test Deployment Channel',
recording_enabled=True,
configuration={'communicationType': 'unified'},
)
)
print(f'Channel created: {channel.id}')
# 6. Create deployment configuration
deployment = client.deployment_configs.create(
CreateDeploymentConfiguration(
project_id=project_id,
deployment_channel_id=channel.id,
agent_configuration_id=agent.id,
instruction_configuration_id=instruction.id,
deployment_name=f'Test_Deployment_{timestamp}',
)
)
print(f'Deployment created: {deployment.id}')
print(f'Status: {deployment.deployment_status}')
# 7. Retrieve deployment
retrieved = client.deployment_configs.get(deployment.id)
print(f'Retrieved deployment: {retrieved.deployment_name}')
# 8. List deployments by project
project_deployments = client.deployment_configs.list_by_project(project_id)
print(f'Project has {len(project_deployments.data)} deployments')
# 9. Update deployment
updated = client.deployment_configs.update(
UpdateDeploymentConfiguration(
id=deployment.id,
deployment_name='Updated_Test_Deployment',
)
)
print(f'Updated name: {updated.deployment_name}')
# 10. Clean up (in reverse order of dependencies)
client.deployment_configs.delete(deployment.id)
print('Deployment deleted')
client.deployment_channels.delete(channel.id)
print('Channel deleted')
client.agent_configs.delete(agent.id)
print('Agent deleted')
client.instruction_configs.delete(instruction.id)
print('Instruction deleted')
print('Cleanup complete!')
if __name__ == '__main__':
create_full_deployment()
Best Practices​
-
Create resources in order - Follow the dependency chain: Project -> Instruction -> Agent -> Channel -> Deployment
-
Delete in reverse order - When cleaning up, delete deployments first, then channels, agents, and instructions
-
Use meaningful deployment names - Names help identify deployments in administrative interfaces
-
Keep isActive false initially - Start with deployments inactive, then activate after verification
-
Use listByX methods for filtering - Use
listByProject(),listByAgent(), orlistByInstruction()for efficient filtering -
One channel per deployment - Remember the 1:1 relationship. Multi-channel requires multiple deployments.
Troubleshooting​
Missing Required References​
Error:
- TypeScript
- Python
WiilValidationError: agentConfigurationId is required
WiilValidationError: agent_configuration_id is required
Solution: Ensure all required IDs are provided and valid:
- TypeScript
- Python
// Verify all IDs exist before creating deployment
const agent = await client.agentConfigs.get(agentId);
const instruction = await client.instructionConfigs.get(instructionId);
const channel = await client.deploymentChannels.get(channelId);
const deployment = await client.deploymentConfigs.create({
projectId: projectId,
deploymentChannelId: channel.id,
agentConfigurationId: agent.id,
instructionConfigurationId: instruction.id,
});
# Verify all IDs exist before creating deployment
agent = client.agent_configs.get(agent_id)
instruction = client.instruction_configs.get(instruction_id)
channel = client.deployment_channels.get(channel_id)
deployment = client.deployment_configs.create(
CreateDeploymentConfiguration(
project_id=project_id,
deployment_channel_id=channel.id,
agent_configuration_id=agent.id,
instruction_configuration_id=instruction.id,
)
)
Channel Already in Use​
Error:
- TypeScript
- Python
WiilAPIError: Deployment channel is already associated with another deployment
WiilAPIError: Deployment channel is already associated with another deployment
Solution: Each channel can only be used by one deployment. Create a new channel or remove the existing deployment:
- TypeScript
- Python
// Check if channel is in use
try {
const existing = await client.deploymentConfigs.getByChannel(channelId);
console.log('Channel already used by deployment:', existing.id);
// Either use a different channel or delete the existing deployment
} catch (error) {
// Channel is available
const deployment = await client.deploymentConfigs.create({
deploymentChannelId: channelId,
// ...
});
}
# Check if channel is in use
try:
existing = client.deployment_configs.get_by_channel(channel_id)
print(f'Channel already used by deployment: {existing.id}')
# Either use a different channel or delete the existing deployment
except Exception:
# Channel is available
deployment = client.deployment_configs.create(
CreateDeploymentConfiguration(
deployment_channel_id=channel_id,
# ...
)
)
Cannot Delete Deployment​
Error:
- TypeScript
- Python
WiilAPIError: Cannot delete active deployment
WiilAPIError: Cannot delete active deployment
Solution: Deactivate the deployment before deleting:
- TypeScript
- Python
// First deactivate
await client.deploymentConfigs.update({
id: deploymentId,
isActive: false,
});
// Then delete
await client.deploymentConfigs.delete(deploymentId);
# First deactivate
client.deployment_configs.update(
UpdateDeploymentConfiguration(
id=deployment_id,
is_active=False,
)
)
# Then delete
client.deployment_configs.delete(deployment_id)
Invalid Provisioning Type​
Error:
- TypeScript
- Python
WiilValidationError: provisioningConfigChainId is required for CHAINED provisioning type
WiilValidationError: provisioning_config_chain_id is required for CHAINED provisioning type
Solution:
Use createChain() for chained deployments or provide the chain ID:
- TypeScript
- Python
// Option 1: Use createChain method
const deployment = await client.deploymentConfigs.createChain({
// ... other fields
provisioningConfigChainId: 'chain_123',
});
// Option 2: Stick with DIRECT provisioning (default)
const deployment = await client.deploymentConfigs.create({
// provisioningType defaults to DIRECT, no chain needed
// ...
});
# Option 1: Use create_chain method
deployment = client.deployment_configs.create_chain(
CreateDeploymentConfiguration(
# ... other fields
provisioning_config_chain_id='chain_123',
)
)
# Option 2: Stick with DIRECT provisioning (default)
deployment = client.deployment_configs.create(
CreateDeploymentConfiguration(
# provisioning_type defaults to DIRECT, no chain needed
# ...
)
)