{
  "manifest_version": "1.0.0",
  "template": {
    "id": "75afcb79-286c-428d-a1e6-6a2b876d3fec",
    "slug": "n8n-8",
    "name": "N8N",
    "description": "n8n + Postgres with external task runners.",
    "url": "https://railway.com/deploy/n8n-8",
    "upstream": {
      "image": "n8nio/n8n:2.40.7"
    }
  },
  "services": [
    {
      "name": "Postgres",
      "source": {
        "image": "ghcr.io/railwayapp-templates/postgres-ssl:18"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    },
    {
      "name": "n8n",
      "source": {
        "image": "n8nio/n8n:2.40.7"
      },
      "needs_volume": true,
      "volume_mount_path": "/home/node/.n8n",
      "http": true
    },
    {
      "name": "n8n-runners",
      "source": {
        "image": "n8nio/runners:2.40.7"
      },
      "needs_volume": false,
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "PGDATA",
      "service": "Postgres",
      "description": "Location where the database will be initialized.",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "PGHOST",
      "service": "Postgres",
      "description": "Private hostname n8n connects to.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PGPORT",
      "service": "Postgres",
      "description": "Port to connect to Postgres.",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "PGUSER",
      "service": "Postgres",
      "description": "Required by the Data panel.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGDATABASE",
      "service": "Postgres",
      "description": "Required by the Data panel.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGPASSWORD",
      "service": "Postgres",
      "description": "Required by the Data panel.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_DB",
      "service": "Postgres",
      "description": "Database n8n stores workflows, credentials and executions in.",
      "secret": false,
      "strategy": "default",
      "default": "railway"
    },
    {
      "key": "DATABASE_URL",
      "service": "Postgres",
      "description": "Private connection string, for other services you add later.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_USER",
      "service": "Postgres",
      "description": "User to connect to Postgres.",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "SSL_CERT_DAYS",
      "service": "Postgres",
      "description": "SSL certificate expiry in days.",
      "secret": false,
      "strategy": "default",
      "default": "820"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "Postgres",
      "description": "Password to connect to Postgres. Generated per deploy.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "Postgres",
      "description": "Lets Postgres shut down cleanly on redeploy.",
      "secret": false,
      "strategy": "default",
      "default": "60"
    },
    {
      "key": "PORT",
      "service": "n8n",
      "description": "Port n8n listens on. Railway's healthcheck and domain use it.",
      "secret": false,
      "strategy": "default",
      "default": "5678"
    },
    {
      "key": "DB_TYPE",
      "service": "n8n",
      "description": "Stores everything in Postgres instead of SQLite.",
      "secret": false,
      "strategy": "default",
      "default": "postgresdb"
    },
    {
      "key": "N8N_PROXY_HOPS",
      "service": "n8n",
      "description": "Proxy hops in front of n8n (Railway's edge adds two), so rate limits see real client IPs.",
      "secret": false,
      "strategy": "default",
      "default": "2"
    },
    {
      "key": "N8N_WEBHOOK_URL",
      "service": "n8n",
      "description": "Public base URL shown for webhook, form and MCP trigger URLs.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "RAILWAY_RUN_UID",
      "service": "n8n",
      "description": "Starts as root to chown the volume; n8n itself then runs as the node user.",
      "secret": false,
      "strategy": "default",
      "default": "0"
    },
    {
      "key": "GENERIC_TIMEZONE",
      "service": "n8n",
      "description": "Timezone for Schedule triggers and dates, e.g. Europe/Berlin.",
      "secret": false,
      "strategy": "default",
      "default": "UTC"
    },
    {
      "key": "N8N_RUNNERS_MODE",
      "service": "n8n",
      "description": "Runs Code nodes in the n8n-runners service instead of inside n8n.",
      "secret": false,
      "strategy": "default",
      "default": "external"
    },
    {
      "key": "DB_POSTGRESDB_HOST",
      "service": "n8n",
      "description": "Postgres host on the private network.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "DB_POSTGRESDB_PORT",
      "service": "n8n",
      "description": "Postgres port.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "DB_POSTGRESDB_USER",
      "service": "n8n",
      "description": "Postgres user.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "N8N_ENCRYPTION_KEY",
      "service": "n8n",
      "description": "Encrypts stored credentials. Generated per deploy; back it up.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "N8N_EDITOR_BASE_URL",
      "service": "n8n",
      "description": "Public URL of the editor, used in links, emails and OAuth redirects.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "DB_POSTGRESDB_DATABASE",
      "service": "n8n",
      "description": "Postgres database name.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "DB_POSTGRESDB_PASSWORD",
      "service": "n8n",
      "description": "Postgres password.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "N8N_RUNNERS_AUTH_TOKEN",
      "service": "n8n",
      "description": "Shared secret n8n-runners uses to connect. Generated per deploy.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "EXECUTIONS_DATA_MAX_AGE",
      "service": "n8n",
      "description": "Hours to keep execution history before pruning (336 = 14 days).",
      "secret": false,
      "strategy": "default",
      "default": "336"
    },
    {
      "key": "N8N_RUNNERS_BROKER_PORT",
      "service": "n8n",
      "description": "Port of the task broker that n8n-runners connects to.",
      "secret": false,
      "strategy": "default",
      "default": "5679"
    },
    {
      "key": "EXECUTIONS_DATA_PRUNE_MAX_COUNT",
      "service": "n8n",
      "description": "Most executions to keep in history. 0 means no limit.",
      "secret": false,
      "strategy": "default",
      "default": "10000"
    },
    {
      "key": "N8N_RUNNERS_BROKER_LISTEN_ADDRESS",
      "service": "n8n",
      "description": "Lets the runners reach the task broker over the private network.",
      "secret": false,
      "strategy": "default",
      "default": "::"
    },
    {
      "key": "PORT",
      "service": "n8n-runners",
      "description": "Port of the launcher's health server, which Railway's healthcheck probes.",
      "secret": false,
      "strategy": "default",
      "default": "5680"
    },
    {
      "key": "GENERIC_TIMEZONE",
      "service": "n8n-runners",
      "description": "Mirrors the main instance's timezone for JavaScript dates.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "N8N_RUNNERS_AUTH_TOKEN",
      "service": "n8n-runners",
      "description": "Must equal the main instance's runner token.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "N8N_RUNNERS_CONFIG_PATH",
      "service": "n8n-runners",
      "description": "Where the start command writes the launcher config.",
      "secret": false,
      "strategy": "default",
      "default": "/tmp/n8n-task-runners.json"
    },
    {
      "key": "N8N_RUNNERS_STDLIB_ALLOW",
      "service": "n8n-runners",
      "description": "Python standard library modules Code nodes may import. * allows all.",
      "secret": false,
      "strategy": "default",
      "default": "json,re,math,cmath,statistics,random,datetime,time,calendar,zoneinfo,string,textwrap,unicodedata,difflib,uuid,hashlib,hmac,base64,binascii,collections,itertools,functools,operator,decimal,fractions,copy,bisect,heapq,enum,dataclasses,typing,html,csv,urllib,ipaddress,struct"
    },
    {
      "key": "N8N_RUNNERS_TASK_TIMEOUT",
      "service": "n8n-runners",
      "description": "Seconds a single Code node may run before it is stopped.",
      "secret": false,
      "strategy": "default",
      "default": "300"
    },
    {
      "key": "N8N_RUNNERS_TASK_BROKER_URI",
      "service": "n8n-runners",
      "description": "Task broker inside the main n8n instance.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "NODE_FUNCTION_ALLOW_BUILTIN",
      "service": "n8n-runners",
      "description": "Node.js built-in modules JavaScript Code nodes may require. * allows all.",
      "secret": false,
      "strategy": "default",
      "default": "crypto"
    },
    {
      "key": "NODE_FUNCTION_ALLOW_EXTERNAL",
      "service": "n8n-runners",
      "description": "npm packages in the image JavaScript Code nodes may require.",
      "secret": false,
      "strategy": "default",
      "default": "moment"
    },
    {
      "key": "N8N_RUNNERS_AUTO_SHUTDOWN_TIMEOUT",
      "service": "n8n-runners",
      "description": "Seconds an idle runner stays up. 0 keeps runners warm.",
      "secret": false,
      "strategy": "default",
      "default": "15"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "n8n-8"
      }
    },
    "cli": "railway deploy --template n8n-8",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "75afcb79-286c-428d-a1e6-6a2b876d3fec",
            "serializedConfig": {
              "services": {
                "0d3dcb13-a9ba-49a5-bb23-34560af29114": {
                  "icon": "https://devicons.railway.com/i/postgresql.svg",
                  "name": "Postgres",
                  "deploy": {
                    "requiredMountPath": "/var/lib/postgresql/data"
                  },
                  "source": {
                    "image": "ghcr.io/railwayapp-templates/postgres-ssl:18"
                  },
                  "variables": {
                    "PGDATA": {
                      "isOptional": false,
                      "description": "Location where the database will be initialized.",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "PGHOST": {
                      "isOptional": false,
                      "description": "Private hostname n8n connects to.",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "PGPORT": {
                      "isOptional": false,
                      "description": "Port to connect to Postgres.",
                      "defaultValue": "5432"
                    },
                    "PGUSER": {
                      "isOptional": false,
                      "description": "Required by the Data panel.",
                      "defaultValue": "${{POSTGRES_USER}}"
                    },
                    "PGDATABASE": {
                      "isOptional": false,
                      "description": "Required by the Data panel.",
                      "defaultValue": "${{POSTGRES_DB}}"
                    },
                    "PGPASSWORD": {
                      "isOptional": false,
                      "description": "Required by the Data panel.",
                      "defaultValue": "${{POSTGRES_PASSWORD}}"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Database n8n stores workflows, credentials and executions in.",
                      "defaultValue": "railway"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "Private connection string, for other services you add later.",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:5432/${{PGDATABASE}}"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "User to connect to Postgres.",
                      "defaultValue": "postgres"
                    },
                    "SSL_CERT_DAYS": {
                      "isOptional": true,
                      "description": "SSL certificate expiry in days.",
                      "defaultValue": "820"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Password to connect to Postgres. Generated per deploy.",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": false,
                      "description": "Lets Postgres shut down cleanly on redeploy.",
                      "defaultValue": "60"
                    }
                  },
                  "networking": {
                    "tcpProxies": {},
                    "serviceDomains": {}
                  },
                  "volumeMounts": {
                    "0d3dcb13-a9ba-49a5-bb23-34560af29114": {
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  }
                },
                "18d17e9a-2e74-4ce1-a0ea-7b695f7004eb": {
                  "icon": "https://devicons.railway.com/i/n8n.svg",
                  "name": "n8n",
                  "deploy": {
                    "startCommand": "sh -c 'test \"$(stat -c %U /home/node/.n8n)\" = node || chown -R node:node /home/node/.n8n; export HOME=/home/node; exec su -p -s /bin/sh node -c \"exec /sbin/tini -- /docker-entrypoint.sh\"'",
                    "healthcheckPath": "/healthz/readiness",
                    "healthcheckTimeout": 600
                  },
                  "source": {
                    "image": "n8nio/n8n:2.40.7"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Port n8n listens on. Railway's healthcheck and domain use it.",
                      "defaultValue": "5678"
                    },
                    "DB_TYPE": {
                      "isOptional": false,
                      "description": "Stores everything in Postgres instead of SQLite.",
                      "defaultValue": "postgresdb"
                    },
                    "N8N_PROXY_HOPS": {
                      "isOptional": false,
                      "description": "Proxy hops in front of n8n (Railway's edge adds two), so rate limits see real client IPs.",
                      "defaultValue": "2"
                    },
                    "N8N_WEBHOOK_URL": {
                      "isOptional": false,
                      "description": "Public base URL shown for webhook, form and MCP trigger URLs.",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "RAILWAY_RUN_UID": {
                      "isOptional": false,
                      "description": "Starts as root to chown the volume; n8n itself then runs as the node user.",
                      "defaultValue": "0"
                    },
                    "GENERIC_TIMEZONE": {
                      "isOptional": false,
                      "description": "Timezone for Schedule triggers and dates, e.g. Europe/Berlin.",
                      "defaultValue": "UTC"
                    },
                    "N8N_RUNNERS_MODE": {
                      "isOptional": false,
                      "description": "Runs Code nodes in the n8n-runners service instead of inside n8n.",
                      "defaultValue": "external"
                    },
                    "DB_POSTGRESDB_HOST": {
                      "isOptional": false,
                      "description": "Postgres host on the private network.",
                      "defaultValue": "${{Postgres.PGHOST}}"
                    },
                    "DB_POSTGRESDB_PORT": {
                      "isOptional": false,
                      "description": "Postgres port.",
                      "defaultValue": "${{Postgres.PGPORT}}"
                    },
                    "DB_POSTGRESDB_USER": {
                      "isOptional": false,
                      "description": "Postgres user.",
                      "defaultValue": "${{Postgres.PGUSER}}"
                    },
                    "N8N_ENCRYPTION_KEY": {
                      "isOptional": false,
                      "description": "Encrypts stored credentials. Generated per deploy; back it up.",
                      "defaultValue": "{{N8N_ENCRYPTION_KEY}}"
                    },
                    "N8N_EDITOR_BASE_URL": {
                      "isOptional": false,
                      "description": "Public URL of the editor, used in links, emails and OAuth redirects.",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "DB_POSTGRESDB_DATABASE": {
                      "isOptional": false,
                      "description": "Postgres database name.",
                      "defaultValue": "${{Postgres.PGDATABASE}}"
                    },
                    "DB_POSTGRESDB_PASSWORD": {
                      "isOptional": false,
                      "description": "Postgres password.",
                      "defaultValue": "${{Postgres.PGPASSWORD}}"
                    },
                    "N8N_RUNNERS_AUTH_TOKEN": {
                      "isOptional": false,
                      "description": "Shared secret n8n-runners uses to connect. Generated per deploy.",
                      "defaultValue": "{{N8N_RUNNERS_AUTH_TOKEN}}"
                    },
                    "EXECUTIONS_DATA_MAX_AGE": {
                      "isOptional": false,
                      "description": "Hours to keep execution history before pruning (336 = 14 days).",
                      "defaultValue": "336"
                    },
                    "N8N_RUNNERS_BROKER_PORT": {
                      "isOptional": false,
                      "description": "Port of the task broker that n8n-runners connects to.",
                      "defaultValue": "5679"
                    },
                    "EXECUTIONS_DATA_PRUNE_MAX_COUNT": {
                      "isOptional": false,
                      "description": "Most executions to keep in history. 0 means no limit.",
                      "defaultValue": "10000"
                    },
                    "N8N_RUNNERS_BROKER_LISTEN_ADDRESS": {
                      "isOptional": false,
                      "description": "Lets the runners reach the task broker over the private network.",
                      "defaultValue": "::"
                    }
                  },
                  "networking": {
                    "tcpProxies": {},
                    "serviceDomains": {
                      "<hasDomain>": {
                        "port": 5678
                      }
                    }
                  },
                  "volumeMounts": {
                    "18d17e9a-2e74-4ce1-a0ea-7b695f7004eb": {
                      "mountPath": "/home/node/.n8n"
                    }
                  }
                },
                "9ae0303b-1a4a-46e7-a945-80f59fa32bf0": {
                  "icon": "https://devicons.railway.com/i/n8n.svg",
                  "name": "n8n-runners",
                  "deploy": {
                    "startCommand": "sh -c 'node <<\"JS\"\nconst fs = require(\"fs\");\nconst cfg = JSON.parse(fs.readFileSync(\"/etc/n8n-task-runners.json\", \"utf8\"));\nconst keys = {\n  javascript: [\"NODE_FUNCTION_ALLOW_BUILTIN\", \"NODE_FUNCTION_ALLOW_EXTERNAL\"],\n  python: [\"N8N_RUNNERS_STDLIB_ALLOW\", \"N8N_RUNNERS_EXTERNAL_ALLOW\"],\n};\nfor (const runner of cfg[\"task-runners\"]) {\n  for (const key of keys[runner[\"runner-type\"]] || []) {\n    if (key in process.env) runner[\"env-overrides\"][key] = process.env[key];\n  }\n}\nfs.writeFileSync(process.env.N8N_RUNNERS_CONFIG_PATH, JSON.stringify(cfg, null, 2));\nJS\nexec /sbin/tini -- /usr/local/bin/task-runner-launcher javascript python'",
                    "healthcheckPath": "/healthz",
                    "healthcheckTimeout": 300
                  },
                  "source": {
                    "image": "n8nio/runners:2.40.7"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Port of the launcher's health server, which Railway's healthcheck probes.",
                      "defaultValue": "5680"
                    },
                    "GENERIC_TIMEZONE": {
                      "isOptional": false,
                      "description": "Mirrors the main instance's timezone for JavaScript dates.",
                      "defaultValue": "${{n8n.GENERIC_TIMEZONE}}"
                    },
                    "N8N_RUNNERS_AUTH_TOKEN": {
                      "isOptional": false,
                      "description": "Must equal the main instance's runner token.",
                      "defaultValue": "${{n8n.N8N_RUNNERS_AUTH_TOKEN}}"
                    },
                    "N8N_RUNNERS_CONFIG_PATH": {
                      "isOptional": false,
                      "description": "Where the start command writes the launcher config.",
                      "defaultValue": "/tmp/n8n-task-runners.json"
                    },
                    "N8N_RUNNERS_STDLIB_ALLOW": {
                      "isOptional": false,
                      "description": "Python standard library modules Code nodes may import. * allows all.",
                      "defaultValue": "json,re,math,cmath,statistics,random,datetime,time,calendar,zoneinfo,string,textwrap,unicodedata,difflib,uuid,hashlib,hmac,base64,binascii,collections,itertools,functools,operator,decimal,fractions,copy,bisect,heapq,enum,dataclasses,typing,html,csv,urllib,ipaddress,struct"
                    },
                    "N8N_RUNNERS_TASK_TIMEOUT": {
                      "isOptional": false,
                      "description": "Seconds a single Code node may run before it is stopped.",
                      "defaultValue": "300"
                    },
                    "N8N_RUNNERS_EXTERNAL_ALLOW": {
                      "isOptional": true,
                      "description": "Third-party Python packages Code nodes may import. None ship in the image.",
                      "defaultValue": ""
                    },
                    "N8N_RUNNERS_TASK_BROKER_URI": {
                      "isOptional": false,
                      "description": "Task broker inside the main n8n instance.",
                      "defaultValue": "http://${{n8n.RAILWAY_PRIVATE_DOMAIN}}:${{n8n.N8N_RUNNERS_BROKER_PORT}}"
                    },
                    "NODE_FUNCTION_ALLOW_BUILTIN": {
                      "isOptional": false,
                      "description": "Node.js built-in modules JavaScript Code nodes may require. * allows all.",
                      "defaultValue": "crypto"
                    },
                    "NODE_FUNCTION_ALLOW_EXTERNAL": {
                      "isOptional": false,
                      "description": "npm packages in the image JavaScript Code nodes may require.",
                      "defaultValue": "moment"
                    },
                    "N8N_RUNNERS_AUTO_SHUTDOWN_TIMEOUT": {
                      "isOptional": false,
                      "description": "Seconds an idle runner stays up. 0 keeps runners warm.",
                      "defaultValue": "15"
                    }
                  },
                  "networking": {
                    "tcpProxies": {},
                    "serviceDomains": {}
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "n8n",
      "method": "GET",
      "path": "/healthz/readiness",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 3,
    "needs_volume": true
  },
  "generated_at": "2026-09-25T16:14:54.488Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-25T12:42:24.558Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_bec48b90c2c64507a0f7",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "healthcheck",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 47,
    "typical_build_seconds": 0,
    "typical_start_seconds": 10,
    "slowest_service": "n8n-runners"
  }
}
