Skip to main content
Deploying AI Builder use cases requires a structured approach to move your solutions from development to production. This guide outlines strategies for versioning, deploying, and managing applications across different environments to ensure reliability and performance.

Deployment Strategies

  • Single Workspace
  • Multi-Workspace
  • Multi-Instance
Best for: Basic applications with minimal complexity, such as simple prompting agentsIn this approach, you use a single workspace for both development and production:
  • Development: Create and test your application directly in the workspace
  • Production: Once tested, the same workspace serves as the production environment
  • Version Control: Use versioning to save stable points for potential rollback
Advantages:
  • Simplest deployment approach
  • No need to migrate between workspaces
  • Quick iteration and updates
Considerations:
  • Limited separation between development and production
  • Higher risk of disruptive changes affecting live users
  • Best suited for applications with low complexity and minimal regulatory constraints

Versioning Your Application

1

Configure Git Repository

Set up version control for your workspace:
  1. Access workspace raw configuration by clicking “Edit source code” in the workspace action menu
  2. Add repository configuration to the end of the file:
repositories:
  github:
    name: My GitHub Repository
    type: git
    mode: read-write
    config:
      url: https://github.com/YourUser/your-repository.git
      branch: main
      auth:
        user: 'your git user'
        password: 'your git password'
You can use secrets for sensitive information:
auth:
  password: '{{secret.gitPassword}}'
For SSH authentication, use:
auth:
  sshkey: |-
    YOUR SSH
    KEY
    HERE
Remember to use git@github.com:YourUser/your-repository.git format for SSH URLs.
2

Push to Repository

Save your workspace state:
  1. From the workspace action menu, select “Versions”
  2. Choose the repository you configured
  3. Click “Push to repository”
  4. Enter a commit message describing your changes
  5. Submit to save the current state
This creates a snapshot of your workspace in the remote repository.
3

Pull from Repository

Retrieve saved workspace state:
  1. From the workspace action menu, select “Versions”
  2. Choose the repository you want to pull from
  3. Click “Pull from repository”
  4. Confirm the operation
This updates your workspace with the state stored in the repository.
4

Exclude Files from Import

Protect specific configurations during pulls:
repositories:
  github:
    name: My GitHub Repository
    type: git
    mode: read-write
    config:
      url: https://github.com/YourUser/your-repository.git
      branch: main
      auth:
        user: 'your git user'
        password: 'your git password'
    pull:
      exclude:
        - path: 'index' # Preserve workspace config
        - path: 'security' # Preserve security settings
        - path: 'pages/custom' # Preserve specific page
This prevents overwriting custom configurations when pulling changes.

Deployment Methods

Use Prisme.ai’s built-in tools to deploy between workspaces:Export/Import Method:
  1. In the source workspace, go to the action menu and select “Export”
  2. Download the workspace archive
  3. In the target workspace, go to the action menu and select “Import”
  4. Upload the workspace archive
  5. Review and confirm changes
Direct Push/Pull Method:
  1. Configure the same Git repository in both source and target workspaces
  2. Push from the source workspace
  3. Pull into the target workspace
Built-in deployment provides a straightforward approach without requiring external tools.
Integrate with DevSecOps pipelines for automated deployment:Setup Steps:
  1. Configure Git repositories for your workspaces
  2. Create CI/CD pipeline in your preferred system (Jenkins, GitHub Actions, etc.)
  3. Set up pipeline stages for testing, validation, and deployment
  4. Configure deployment scripts using Prisme.ai API
  5. Implement approval gates for production deployments
Pipeline Example:
# Example GitHub Actions workflow
name: Deploy Workspace

on:
  push:
    branches: [ main ]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      
      - name: Validate configuration
        run: ./validate-config.sh
        
      - name: Deploy to staging
        run: ./deploy.sh staging
        
      - name: Run tests
        run: ./run-tests.sh
        
      - name: Deploy to production
        if: success()
        run: ./deploy.sh production
CI/CD integration provides automated, consistent deployments with added security and validation.
Create custom deployment processes using the Prisme.ai API:Key API Endpoints:
  • GET /workspaces/{id}/export - Export workspace
  • POST /workspaces/{id}/import - Import workspace
  • POST /workspaces/{id}/push - Push to repository
  • POST /workspaces/{id}/pull - Pull from repository
Example Script:
// Example Node.js deployment script
const axios = require('axios');

async function deployWorkspace(sourceId, targetId, apiKey) {
  // Export source workspace
  const exportResponse = await axios.get(`https://api.studio.prisme.ai/v2/workspaces/${sourceId}/export`, {
    headers: { 'Authorization': `Bearer ${apiKey}` },
    responseType: 'arraybuffer'
  });
  
  // Import to target workspace
  await axios.post(`https://api.studio.prisme.ai/v2/workspaces/${targetId}/import`, 
    exportResponse.data,
    { 
      headers: { 
        'Authorization': `Bearer ${apiKey}`,
        'Content-Type': 'application/octet-stream'
      }
    }
  );
  
  console.log('Deployment completed successfully');
}

deployWorkspace('source-workspace-id', 'target-workspace-id', 'your-api-key');
API-based deployment provides the most flexibility for custom deployment workflows.

Understanding What’s Versioned

Included in Versioning

Workspace components that are saved and deployed:

  • Pages and their configurations
  • Blocks and custom components
  • Automations and workflows
  • Security roles and permissions
  • App configurations
  • Workspace settings

Not Included in Versioning

Data that remains specific to each environment:

  • Events and their history
  • Collection data
  • Crawled documents
  • Uploaded files
  • User-specific settings
  • Runtime state
The versioned content is identical to what’s included in the workspace export archive.

Environment-Specific Configuration

Manage differences between environments:
1

Use Workspace Secrets

Store environment-specific values as secrets:
# In development workspace
secrets:
  apiEndpoint: https://dev-api.example.com
  maxRequests: 10

# In production workspace
secrets:
  apiEndpoint: https://api.example.com
  maxRequests: 100
Access these values in your application using:
{{secret.apiEndpoint}}
2

Conditional Logic

Implement environment-aware behavior in automations:
# Example automation with environment detection
slug: processData
do:
  - conditions: 
    "{{environment}} == 'production'":
      - callAPI:
          url: "{{secret.productionApi}}"
    default:
      - callAPI:
          url: "{{secret.developmentApi}}"
This allows your applications to adapt to different environments.

Handling Pull Results

After each import or repository pull, Prisme.ai emits a workspaces.imported event with details:
{
 "files": [
  "index",
  "security",
  "pages/test.yml",
   ...
 ],
 "deleted": [
  "automations/removedAutomation.yml"
 ],
 "version": {
  "name": "latest",
  "repository": {
   "id": "yourRepositoryId"
  }
 },
 "errors": [
  {
   "msg": "Could not rename workspace slug from {oldSlug} to {newSlug} as it is already used by workspaceId zlkpbRF",
   "err": "SlugAlreadyInUse",
   "conflictingWorkspaceId": "..."
  }
 ]
}
You can create automations that listen for this event to:
  • Log deployment activities
  • Notify team members of successful deployments
  • Track errors and conflicts
  • Trigger post-deployment tasks

Deployment Best Practices

Version Everything

Maintain complete history of your application:

  • Commit changes frequently with clear messages
  • Use branches for feature development
  • Tag important releases (e.g., v1.0.0)
  • Document significant version changes
  • Never work directly in production

Test Before Deployment

Validate thoroughly before moving to production:

  • Test in development environment first
  • Verify integrations with external systems
  • Test with realistic data sets
  • Include user acceptance testing
  • Conduct security testing

Controlled Deployment

Implement safeguards around deployment:

  • Use approval workflows for production changes
  • Deploy during low-traffic periods
  • Implement monitoring during deployment
  • Prepare rollback procedures
  • Document deployment steps

Environment Isolation

Maintain clear boundaries between environments:

  • Use separate API keys for each environment
  • Configure different external service endpoints
  • Apply appropriate security controls by environment
  • Use visual indicators to distinguish environments
  • Limit production access to necessary personnel

Troubleshooting Deployments

Common causes and solutions for import problems:Issue: Slug Conflicts
"Could not rename workspace slug from {oldSlug} to {newSlug} as it is already used"
Solution: Ensure unique slugs across workspaces or exclude index file from import.Issue: Missing Dependencies
"Cannot find referenced component {componentId}"
Solution: Ensure all dependencies are included in the import or available in the target workspace.Issue: Permission Errors
"User does not have permission to update {resource}"
Solution: Verify user has appropriate permissions in the target workspace.
Troubleshooting problems after deployment:Issue: Integration FailuresCauses:
  • Different service endpoints in the new environment
  • Missing or invalid credentials
  • Network access restrictions
Solution: Update environment-specific configurations and verify connectivity.Issue: Performance ProblemsCauses:
  • Different resource allocations between environments
  • Increased load in production
  • Data volume differences
Solution: Monitor performance metrics and adjust resource allocations as needed.
How to revert to a previous state:Git-Based Rollback:
  1. Identify the stable version tag or commit
  2. Pull that specific version into your workspace:
repositories:
  github:
    config:
      branch: main
      tag: v1.0.0  # Or specific commit hash
Export/Import Rollback:
  1. Maintain archives of known-good workspace states
  2. Import the last stable archive if issues occur
Best Practice: Test rollback procedures regularly to ensure they work when needed.

Next Steps