Deploy n8n Assistant Sandbox
Makes n8n's AI Assistant work on Railway: code sandbox and web search.
Just deployed
Just deployed
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.

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
- In your n8n's project, click Add, then Template, pick n8n Assistant Sandbox and click Deploy Template.
- Open your n8n service and look at its Variables tab. If
N8N_ENCRYPTION_KEYisn't listed, go to its Console tab, typecat ~/.n8n/config, press Enter and copy theencryptionKeyvalue. Without it, the redeploy below locks n8n out of its own data. - Back in the Variables tab, click Raw Editor. If you copied a key, add
N8N_ENCRYPTION_KEY=the-key-you-copiedon 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
- Click Deploy on the bar that lists your changes, and wait for n8n to restart.
- 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).


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

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