{
  "manifest_version": "1.0.0",
  "template": {
    "id": "f628aad8-115b-481b-b3e3-22b56aeabdbf",
    "slug": "mage",
    "name": "Mage AI",
    "description": "Notebook-style tool for building and scheduling data pipelines",
    "url": "https://railway.com/deploy/mage",
    "upstream": {
      "repo_url": "https://github.com/gridalpha/mage-railway"
    }
  },
  "services": [
    {
      "name": "mage",
      "source": {
        "repo": "https://github.com/gridalpha/mage-railway"
      },
      "needs_volume": true,
      "volume_mount_path": "/home/src",
      "http": true
    },
    {
      "name": "Postgres",
      "source": {
        "image": "ghcr.io/railwayapp-templates/postgres-ssl:18"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    },
    {
      "name": "Redis",
      "source": {
        "image": "redis:8.2"
      },
      "needs_volume": true,
      "volume_mount_path": "/data",
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "PORT",
      "service": "mage",
      "description": "HTTP port the server listens on",
      "secret": false,
      "strategy": "default",
      "default": "6789"
    },
    {
      "key": "REDIS_URL",
      "service": "mage",
      "description": "Job queue liveness and scheduler lock",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "SERVER_VERBOSITY",
      "service": "mage",
      "description": "Application and Tornado log level",
      "secret": false,
      "strategy": "default",
      "default": "info"
    },
    {
      "key": "DEFAULT_OWNER_EMAIL",
      "service": "mage",
      "description": "Email of the first owner user",
      "secret": false,
      "strategy": "default",
      "default": "admin@example.com"
    },
    {
      "key": "DEFAULT_OWNER_PASSWORD",
      "service": "mage",
      "description": "Password of the first owner user",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "DEFAULT_OWNER_USERNAME",
      "service": "mage",
      "description": "Username of the first owner user",
      "secret": false,
      "strategy": "default",
      "default": "admin"
    },
    {
      "key": "DISABLE_AUTO_BROWSER_OPEN",
      "service": "mage",
      "description": "Do not open a browser at startup",
      "secret": false,
      "strategy": "default",
      "default": "1"
    },
    {
      "key": "SCHEDULER_TRIGGER_INTERVAL",
      "service": "mage",
      "description": "Seconds between scheduler ticks",
      "secret": false,
      "strategy": "default",
      "default": "10"
    },
    {
      "key": "REQUIRE_USER_AUTHENTICATION",
      "service": "mage",
      "description": "Require sign-in for the UI and API",
      "secret": false,
      "strategy": "default",
      "default": "1"
    },
    {
      "key": "MAGE_DATABASE_CONNECTION_URL",
      "service": "mage",
      "description": "Metadata database connection string",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "MAGE_ACCESS_TOKEN_EXPIRY_TIME",
      "service": "mage",
      "description": "Session token lifetime in seconds",
      "secret": true,
      "strategy": "default",
      "default": "2592000"
    },
    {
      "key": "PGDATA",
      "service": "Postgres",
      "description": "Cluster location on the volume",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "PGHOST",
      "service": "Postgres",
      "description": "Data panel alias, not read by the server",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PGPORT",
      "service": "Postgres",
      "description": "Data panel alias, not read by the server",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "PGUSER",
      "service": "Postgres",
      "description": "Data panel alias, not read by the server",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGDATABASE",
      "service": "Postgres",
      "description": "Data panel alias, not read by the server",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGPASSWORD",
      "service": "Postgres",
      "description": "Data panel alias, not read by the server",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_DB",
      "service": "Postgres",
      "description": "Database created on first boot",
      "secret": false,
      "strategy": "default",
      "default": "railway"
    },
    {
      "key": "DATABASE_URL",
      "service": "Postgres",
      "description": "Private connection string",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_USER",
      "service": "Postgres",
      "description": "Superuser created on first boot",
      "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": "Superuser password",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "Postgres",
      "description": "Clean shutdown window",
      "secret": false,
      "strategy": "default",
      "default": "60"
    },
    {
      "key": "REDISHOST",
      "service": "Redis",
      "description": "Data panel alias, not read by the server",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "REDISPORT",
      "service": "Redis",
      "description": "Data panel alias, not read by the server",
      "secret": false,
      "strategy": "default",
      "default": "6379"
    },
    {
      "key": "REDISUSER",
      "service": "Redis",
      "description": "Data panel alias, not read by the server",
      "secret": false,
      "strategy": "default",
      "default": "default"
    },
    {
      "key": "REDIS_URL",
      "service": "Redis",
      "description": "Private connection string",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "REDISPASSWORD",
      "service": "Redis",
      "description": "Data panel alias, not read by the server",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "REDIS_PASSWORD",
      "service": "Redis",
      "description": "Auth password, read by the server",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "mage"
      }
    },
    "cli": "railway deploy --template mage",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "f628aad8-115b-481b-b3e3-22b56aeabdbf",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "be5da5db-00cf-4553-ba81-f13f94033070": {
                  "icon": "https://raw.githubusercontent.com/mage-ai/assets/main/logo/m1.svg",
                  "name": "mage",
                  "deploy": {
                    "startCommand": "",
                    "healthcheckPath": "/api/status",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "https://github.com/gridalpha/mage-railway",
                    "rootDirectory": null
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "HTTP port the server listens on",
                      "defaultValue": "6789"
                    },
                    "REDIS_URL": {
                      "isOptional": false,
                      "description": "Job queue liveness and scheduler lock",
                      "defaultValue": "${{Redis.REDIS_URL}}"
                    },
                    "SERVER_VERBOSITY": {
                      "isOptional": true,
                      "description": "Application and Tornado log level",
                      "defaultValue": "info"
                    },
                    "DEFAULT_OWNER_EMAIL": {
                      "isOptional": false,
                      "description": "Email of the first owner user",
                      "defaultValue": "admin@example.com"
                    },
                    "DEFAULT_OWNER_PASSWORD": {
                      "isOptional": false,
                      "description": "Password of the first owner user",
                      "defaultValue": "{{DEFAULT_OWNER_PASSWORD}}"
                    },
                    "DEFAULT_OWNER_USERNAME": {
                      "isOptional": false,
                      "description": "Username of the first owner user",
                      "defaultValue": "admin"
                    },
                    "DISABLE_AUTO_BROWSER_OPEN": {
                      "isOptional": false,
                      "description": "Do not open a browser at startup",
                      "defaultValue": "1"
                    },
                    "SCHEDULER_TRIGGER_INTERVAL": {
                      "isOptional": true,
                      "description": "Seconds between scheduler ticks",
                      "defaultValue": "10"
                    },
                    "REQUIRE_USER_AUTHENTICATION": {
                      "isOptional": false,
                      "description": "Require sign-in for the UI and API",
                      "defaultValue": "1"
                    },
                    "MAGE_DATABASE_CONNECTION_URL": {
                      "isOptional": false,
                      "description": "Metadata database connection string",
                      "defaultValue": "${{Postgres.DATABASE_URL}}"
                    },
                    "MAGE_ACCESS_TOKEN_EXPIRY_TIME": {
                      "isOptional": true,
                      "description": "Session token lifetime in seconds",
                      "defaultValue": "2592000"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:6789": {
                        "port": 6789
                      }
                    }
                  },
                  "volumeMounts": {
                    "be5da5db-00cf-4553-ba81-f13f94033070": {
                      "mountPath": "/home/src"
                    }
                  }
                },
                "c94d75f6-2685-4b88-9e89-c87fa5b1e2ba": {
                  "icon": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/postgresql.svg",
                  "name": "Postgres",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "ghcr.io/railwayapp-templates/postgres-ssl:18"
                  },
                  "variables": {
                    "PGDATA": {
                      "isOptional": false,
                      "description": "Cluster location on the volume",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "PGHOST": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "PGPORT": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "5432"
                    },
                    "PGUSER": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "${{POSTGRES_USER}}"
                    },
                    "PGDATABASE": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "${{POSTGRES_DB}}"
                    },
                    "PGPASSWORD": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "${{POSTGRES_PASSWORD}}"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Database created on first boot",
                      "defaultValue": "railway"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "Private connection string",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:5432/${{PGDATABASE}}"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "Superuser created on first boot",
                      "defaultValue": "postgres"
                    },
                    "SSL_CERT_DAYS": {
                      "isOptional": false,
                      "description": "SSL certificate expiry in days",
                      "defaultValue": "820"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Superuser password",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": false,
                      "description": "Clean shutdown window",
                      "defaultValue": "60"
                    }
                  },
                  "volumeMounts": {
                    "c94d75f6-2685-4b88-9e89-c87fa5b1e2ba": {
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  }
                },
                "cfce99df-c084-4377-ade6-67bccc045519": {
                  "icon": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/redis.svg",
                  "name": "Redis",
                  "deploy": {
                    "startCommand": "/bin/sh -c \"rm -rf $RAILWAY_VOLUME_MOUNT_PATH/lost+found/ && exec docker-entrypoint.sh redis-server --requirepass $REDIS_PASSWORD --save 60 1 --dir $RAILWAY_VOLUME_MOUNT_PATH\"",
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "redis:8.2"
                  },
                  "variables": {
                    "REDISHOST": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "REDISPORT": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "6379"
                    },
                    "REDISUSER": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "default"
                    },
                    "REDIS_URL": {
                      "isOptional": false,
                      "description": "Private connection string",
                      "defaultValue": "redis://${{REDISUSER}}:${{REDIS_PASSWORD}}@${{REDISHOST}}:${{REDISPORT}}"
                    },
                    "REDISPASSWORD": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "${{REDIS_PASSWORD}}"
                    },
                    "REDIS_PASSWORD": {
                      "isOptional": false,
                      "description": "Auth password, read by the server",
                      "defaultValue": "{{REDIS_PASSWORD}}"
                    }
                  },
                  "volumeMounts": {
                    "cfce99df-c084-4377-ade6-67bccc045519": {
                      "mountPath": "/data"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "mage",
      "method": "GET",
      "path": "/api/status",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 3,
    "needs_volume": true
  },
  "generated_at": "2026-09-11T22:14:37.124Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-11T20:02:43.860Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_eeefc5d55a5c45be975c",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "healthcheck",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 190,
    "typical_build_seconds": 101,
    "typical_start_seconds": 40,
    "slowest_service": "mage"
  }
}
