sim
sim copied to clipboard
[REQUEST] Add Workflow Management API/SDK for CI/CD and GitOps
Is your feature request related to a problem? Please describe.
The current SDK only supports workflow execution, not workflow management. This prevents:
- Automating workflow deployments via CI/CD pipelines
- Version controlling workflows as code (GitOps)
- Promoting workflows across environments (dev → staging → prod)
- Rolling back to previous workflow versions
- Programmatically creating/updating workflows
Currently, workflows must be manually created and updated through the UI in each environment, which is error-prone and doesn't scale for production deployments.
Describe the solution you'd like
Extending the Python SDK and REST API with workflow management capabilities:
SDK Methods:
from simstudio import SimStudioClient
client = SimStudioClient(api_key="sk-...", base_url="https://sim.ai")
# Create workflow
workflow = client.create_workflow(name="...", workspace_id="...")
# Update workflow definition
client.update_workflow(workflow_id="...", definition={...})
# Export workflow as JSON
json_content = client.export_workflow(workflow_id="...")
# Import workflow from file
workflow = client.import_workflow(file_path="workflow.json", workspace_id="...")
# Deploy workflow
client.deploy_workflow(workflow_id="...", environment="production")
# List, get, delete, clone workflows
workflows = client.list_workflows(workspace_id="...")
definition = client.get_workflow(workflow_id="...")
client.delete_workflow(workflow_id="...")
new_workflow = client.clone_workflow(workflow_id="...")
Use Cases:
- CI/CD: Deploy workflows automatically on git push
- GitOps: Version control workflows as JSON files
- Environment promotion: Export from dev, import to prod
- Testing: Create test workflows programmatically
- Backup: Export all workflows for disaster recovery
Describe alternatives you've considered
- Manual UI management - Doesn't scale, error-prone, no version control
- Database manipulation - Not officially supported, risky
- UI JSON export/import - Still manual, no automation possible
Additional context
Example CI/CD workflow:
# .github/workflows/deploy-workflows.yml
- name: Deploy workflows
run: |
pip install simstudio-sdk
python deploy_workflows.py
# deploy_workflows.py
for workflow_file in glob.glob("workflows/*.json"):
workflow = client.import_workflow(file_path=workflow_file)
client.deploy_workflow(workflow.id)
Benefits:
- Enables CI/CD integration
- Supports GitOps practices
- Reduces deployment errors
- Enables environment parity
- Provides rollback capability