Deploy n8n Assistant Sandbox

Makes n8n's AI Assistant work on Railway: code sandbox and web search.

Deploy n8n Assistant Sandbox

Deploy and Host n8n Assistant Sandbox on Railway

n8n's AI Assistant builds and fixes workflows from a chat, but it needs a code sandbox that Railway can't normally run. Add this template to your n8n's project and the Assistant works, with web search included.

Your n8n connected to n8n Assistant Sandbox and web search

About Hosting n8n Assistant Sandbox

Needs n8n 2.44 or later and the Hobby plan: the Sandbox uses up to 0.9 GB while the Assistant builds a workflow.

Connect it to your n8n

  1. In your n8n's project, click Add, then Template, pick n8n Assistant Sandbox and click Deploy Template.
  2. Open your n8n service and look at its Variables tab. If N8N_ENCRYPTION_KEY isn't listed, go to its Console tab, type cat ~/.n8n/config, press Enter and copy the encryptionKey value. Without it, the redeploy below locks n8n out of its own data.
  3. Back in the Variables tab, click Raw Editor. If you copied a key, add N8N_ENCRYPTION_KEY=the-key-you-copied on a new line. Paste this block below it, then click Update Variables:
N8N_INSTANCE_AI_SANDBOX_ENABLED=true
N8N_INSTANCE_AI_SANDBOX_PROVIDER=n8n-sandbox
N8N_INSTANCE_AI_SANDBOX_API_URL=http://${{Sandbox.RAILWAY_PRIVATE_DOMAIN}}:8080
N8N_SANDBOX_SERVICE_URL=http://${{Sandbox.RAILWAY_PRIVATE_DOMAIN}}:8080
N8N_SANDBOX_SERVICE_API_KEY=${{Sandbox.SANDBOX_API_KEYS}}
N8N_INSTANCE_AI_SEARXNG_URL=http://${{SearXNG.RAILWAY_PRIVATE_DOMAIN}}:8080
  1. Click Deploy on the bar that lists your changes, and wait for n8n to restart.
  2. In n8n, open Assistant and click Get started. The sandbox and web search are already set up: choose your AI provider and paste its API key (how to get an OpenAI key is below).

Add the template to your n8n's project and paste the block

Create an OpenAI key and paste it into n8n's Assistant

Common Use Cases

  • Build workflows from a chat
  • Debug failed executions
  • Search API docs

Dependencies for n8n Assistant Sandbox Hosting

  • Sandbox
  • SearXNG

Deployment Dependencies

Implementation Details

n8n Assistant Sandbox architecture

Sandboxes share one service. A Railway project token in its RAILWAY_TOKEN variable gives each conversation its own Railway Sandbox VM instead.

Why Deploy n8n Assistant Sandbox on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying n8n Assistant Sandbox on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.

Updated 2026-10-29: First release.


Template Content

More templates in this category

View Template
N8N Main + Worker
Deploy and Host N8N with Inactive worker.

jakemerson
120
View Template
Evolution API with n8n
Automate WhatsApp workflows with Evolution API, n8n, and Postgres.

codestorm
102
View Template
Postgres Backup
Cron-based PostgreSQL backup to bucket storage

Railway Templates
869