Sim is an AI-powered workflow automation platform that enables users to build, deploy, and execute multi-step workflows through a visual canvas editor. This document provides a technical overview of the platform's architecture, core components, and deployment models. For detailed information about specific subsystems, refer to:
Sources: README.md1-224 apps/sim/package.json1-212 package.json1-55
The Sim platform is organized as a Turborepo-based monorepo with two main applications and several shared packages.
Sources: package.json7-9 bun.lock4-311 apps/sim/package.json1-212 apps/docs/package.json1-43
| Application | Path | Technology | Port | Purpose |
|---|---|---|---|---|
| sim | apps/sim | Next.js 16.1.0-canary.21 | 3000 | Main workflow builder and execution platform |
| docs | apps/docs | Fumadocs 16.2.3 | 3001 | Documentation site with MDX content |
Sources: apps/sim/package.json1-24 apps/docs/package.json1-12
| Package | Path | Description | Key Dependencies |
|---|---|---|---|
| @sim/db | packages/db | PostgreSQL schema definitions using Drizzle ORM | drizzle-orm@^0.44.5, postgres@^3.4.5 |
| @sim/logger | packages/logger | Chalk-based logging with color support | [email protected] |
| @sim/tsconfig | packages/tsconfig | Shared TypeScript configurations (base, Next.js, library) | - |
| @sim/testing | packages/testing | Vitest test utilities and helpers | vitest@^3.0.8 |
Sources: bun.lock251-310 packages/tsconfig/package.json1-13
The platform runs as three separate services that communicate via HTTP and WebSockets.
Sources: apps/sim/package.json11-14 README.md200-213
The primary HTTP server runs as a Next.js App Router application with custom server configuration.
| Aspect | Details |
|---|---|
| Entry Point | apps/sim/server.js (production), next dev (development) |
| Port | 3000 (configurable via --port flag) |
| Runtime | Bun 1.2.13+ or Node.js 20.0.0+ |
| Configuration | next.config.ts1-342 |
| Key Routes | /api/workflows/:id/execute, /api/copilot/chat, /api/tools/* |
Sources: apps/sim/package.json6-16 apps/sim/next.config.ts1-342
A dedicated Socket.io server handles real-time collaborative editing and live execution updates.
| Aspect | Details |
|---|---|
| Entry Point | apps/sim/socket/index.ts |
| Port | 3002 |
| Protocol | WebSocket with Socket.io |
| Environment Variable | NEXT_PUBLIC_SOCKET_URL (defaults to http://localhost:3002) |
| Features | Collaborative editing, live execution updates, multiplayer cursors |
Sources: apps/sim/package.json13-14
The DAG executor orchestrates workflow execution with block handlers and sandboxed environments.
| Component | Location | Purpose |
|---|---|---|
| Executor Core | apps/sim/executor | DAG-based execution orchestration |
| Block Handlers | apps/sim/blocks | Handler implementations for each block type |
| JavaScript Sandbox | [email protected] | Sandboxed code execution (128MB limit) |
| Python Sandbox | @e2b/code-interpreter@^2.0.0 | Remote Python execution with imports |
Sources: apps/sim/tsconfig.json22-23 bun.lock112-143
| Technology | Version | Purpose |
|---|---|---|
| PostgreSQL | 12+ | Primary relational database |
| pgvector | Latest | Vector embeddings for knowledge bases |
| Drizzle ORM | 0.44.5 | Type-safe database access layer |
| postgres | 3.4.5 | PostgreSQL client library |
Sources: README.md113-129 bun.lock96-166
| Service | Technology | Purpose |
|---|---|---|
| Redis | ioredis@^5.6.0 | Rate limiting (token bucket), execution cancellation flags, session caching |
| Trigger.dev | @trigger.dev/[email protected] | Background job queue (async workflow execution, webhooks, scheduled runs, log cleanup) |
Sources: apps/sim/package.json110 bun.lock80
Sim supports three primary deployment models with varying infrastructure requirements.
| Model | Infrastructure | Hosting | Management | Use Case |
|---|---|---|---|---|
| Cloud Hosted | Managed by Sim | sim.ai | Fully managed | Quick start, no infrastructure setup |
| NPM Package | Local Docker | npx simstudio | Docker required | Local development, testing |
| Self-Hosted | User-managed | Docker/Kubernetes/VPS | User-managed | Production, custom infrastructure |
Sources: README.md41-152 apps/docs/content/docs/en/self-hosting/index.mdx1-58
| Container | Image | Purpose | Lifecycle |
|---|---|---|---|
| simstudio | Custom (Next.js app) | Main application server | Persistent |
| realtime | Custom (Socket.io) | WebSocket server | Persistent |
| db | pgvector/pgvector:pg17 | PostgreSQL database | Persistent |
| migrations | Custom (Drizzle Kit) | Database schema setup | Run-once |
| ollama | ollama/ollama | Local AI models | Optional |
Sources: README.md64-98 apps/docs/content/docs/en/self-hosting/docker.mdx1-151
For enterprise deployments, Helm charts are provided with support for AWS EKS, Azure AKS, and GCP GKE.
| Component | Chart Location | Configuration |
|---|---|---|
| Helm Chart | helm/sim | Main deployment chart with NetworkPolicies |
| AWS Example | helm/sim/examples/values-aws.yaml | EKS-specific configuration |
| Azure Example | helm/sim/examples/values-azure.yaml | AKS-specific configuration |
| GCP Example | helm/sim/examples/values-gcp.yaml | GKE-specific configuration |
Sources: apps/docs/content/docs/en/self-hosting/kubernetes.mdx1-128
| Technology | Version | Purpose |
|---|---|---|
| Bun | 1.3.3 | Primary JavaScript runtime (package manager, bundler) |
| Node.js | 20.0.0+ | Alternative runtime for production |
| Next.js | 16.1.0-canary.21 | React framework with App Router |
| React | 19.2.1 | UI library |
| TypeScript | 5.7.3 | Type-safe JavaScript |
Sources: package.json3 apps/sim/package.json6-226
| Technology | Version | Purpose |
|---|---|---|
| Zustand | 4.5.7 | Client-side state management (useWorkflowStore, useSubBlockStore, useOperationQueue) |
| ReactFlow | 11.11.4 | Visual workflow canvas editor |
| Shadcn UI | Latest | UI component library |
| Tailwind CSS | 3.4.1 | Utility-first CSS framework |
| Framer Motion | 12.5.0 | Animation library |
Sources: apps/sim/package.json101-166 README.md206-209
| Technology | Version | Purpose |
|---|---|---|
| Better Auth | 1.3.12 | Authentication system with email/password, OAuth, SSO |
| @better-auth/sso | 1.3.12 | Single sign-on support |
| jose | 6.0.11 | JWT token handling |
| isolated-vm | 6.0.2 | Sandboxed JavaScript code execution |
Sources: apps/sim/package.json37-113 README.md205
| Technology | Version | Purpose |
|---|---|---|
| Drizzle ORM | 0.44.5 | Type-safe ORM with schema migrations |
| postgres | 3.4.5 | PostgreSQL client |
| ioredis | 5.6.0 | Redis client for caching |
| @aws-sdk/client-s3 | 3.779.0 | S3 storage integration |
| @azure/storage-blob | 12.27.0 | Azure Blob storage integration |
Sources: apps/sim/package.json31-135 README.md204
| Technology | Version | Purpose |
|---|---|---|
| openai | 4.91.1 | OpenAI API integration |
| @anthropic-ai/sdk | 0.39.0 | Anthropic Claude integration |
| @google/genai | 1.34.0 | Google Gemini integration |
| groq-sdk | 0.15.0 | Groq API integration |
| @e2b/code-interpreter | 2.0.0 | E2B sandbox for Python execution |
| @modelcontextprotocol/sdk | 1.20.2 | Model Context Protocol (MCP) support |
Sources: apps/sim/package.json27-132
| Technology | Version | Purpose |
|---|---|---|
| Turborepo | 2.7.4 | Monorepo build orchestration |
| Vitest | 3.0.8 | Unit testing framework |
| @biomejs/biome | 2.0.0-beta.5 | Linting and formatting |
| drizzle-kit | 0.31.4 | Database migration CLI |
Sources: package.json36-45 apps/sim/package.json197
| Variable | Purpose | Generation Method |
|---|---|---|
DATABASE_URL | PostgreSQL connection string | postgresql://user:pass@host:5432/db |
BETTER_AUTH_SECRET | Authentication secret | openssl rand -hex 32 |
BETTER_AUTH_URL | Authentication callback URL | https://sim.yourdomain.com |
ENCRYPTION_KEY | Encrypts environment variables in database | openssl rand -hex 32 |
INTERNAL_API_SECRET | Secures internal API routes | openssl rand -hex 32 |
API_ENCRYPTION_KEY | Encrypts stored API keys | openssl rand -hex 32 |
NEXT_PUBLIC_APP_URL | Public-facing application URL | https://sim.yourdomain.com |
NEXT_PUBLIC_SOCKET_URL | WebSocket server URL | https://sim.yourdomain.com or http://localhost:3002 |
Sources: README.md160-173 apps/docs/content/docs/en/self-hosting/environment-variables.mdx8-18
Multiple AI providers can be configured with load balancing support using numbered suffixes.
| Provider | Environment Variable Pattern | Example |
|---|---|---|
| OpenAI | OPENAI_API_KEY_1, OPENAI_API_KEY_2 | sk-... |
| Anthropic | ANTHROPIC_API_KEY_1, ANTHROPIC_API_KEY_2 | sk-ant-... |
| Google Gemini | GEMINI_API_KEY_1, GEMINI_API_KEY_2 | AIza... |
| Ollama | OLLAMA_URL | http://localhost:11434 |
| vLLM | VLLM_BASE_URL, VLLM_API_KEY | http://localhost:8000/v1 |
| Azure OpenAI | AZURE_OPENAI_API_KEY, AZURE_OPENAI_ENDPOINT | Provider-specific |
Sources: README.md100-102 apps/docs/content/docs/en/self-hosting/environment-variables.mdx20-52
The root layout provides global providers and configuration for the entire application.
| Provider | Source | Purpose |
|---|---|---|
| PostHogProvider | app/_shell/providers/posthog-provider | Analytics tracking |
| ThemeProvider | app/_shell/providers/theme-provider | Dark/light mode with next-themes |
| QueryProvider | app/_shell/providers/query-provider | TanStack Query configuration |
| SessionProvider | app/_shell/providers/session-provider | Better Auth session context |
| TooltipProvider | app/_shell/providers/tooltip-provider | Radix UI tooltip configuration |
| BrandedLayout | components/branded-layout | White-label branding support |
Sources: apps/sim/app/layout.tsx1-229
The application includes several blocking and non-blocking scripts for initialization.
| Script | Purpose | Strategy | Lines |
|---|---|---|---|
| PublicEnvScript | Exposes environment variables to client | Blocking | apps/sim/app/layout.tsx210 |
| workspace-layout-dimensions | Pre-hydration CSS variable setup (sidebar width, panel width, terminal height) | Blocking inline | apps/sim/app/layout.tsx72-190 |
| theme-override | Custom CSS for white-label branding | Blocking inline | apps/sim/app/layout.tsx193-200 |
| OneDollarStats | Analytics script | Async | apps/sim/app/layout.tsx208 |
Sources: apps/sim/app/layout.tsx31-211
npx simstudio (requires Docker)git clone https://github.com/simstudioai/sim.gitbun install.env.example files and configure secretsbun run dev:full (starts both HTTP and WebSocket servers)Sources: README.md41-152 package.json11-26
Refresh this wiki
This wiki was recently refreshed. Please wait 1 day to refresh again.