{
  "manifest_version": "1.0.0",
  "template": {
    "id": "37cf01a6-4b98-410b-b096-d306b6207e4b",
    "slug": "workhorse-postgresql-queue",
    "name": "Workhorse PostgreSQL queue",
    "description": "PostgreSQL durable tasks with crash recovery and protected dashboard.",
    "url": "https://railway.com/deploy/workhorse-postgresql-queue",
    "upstream": {
      "repo_url": "https://github.com/tech-progress/workhorse-postgres-queue"
    }
  },
  "services": [
    {
      "name": "Worker",
      "source": {
        "repo": "https://github.com/tech-progress/workhorse-postgres-queue"
      },
      "needs_volume": false,
      "http": false
    },
    {
      "name": "Dashboard",
      "source": {
        "repo": "https://github.com/tech-progress/workhorse-postgres-queue"
      },
      "needs_volume": false,
      "http": true
    },
    {
      "name": "Postgres",
      "source": {
        "image": "postgres:17.11-bookworm@sha256:639ab7ceb90e13123085b741fb31ef493fba25463002f6da665352e7b534b652"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "PORT",
      "service": "Worker",
      "description": "Internal listener/probe target port; do not expose private services.",
      "secret": false,
      "strategy": "default",
      "default": "3000"
    },
    {
      "key": "DATABASE_URL",
      "service": "Worker",
      "description": "Direct private PostgreSQL connection using service references; no public database endpoint.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "WORKER_CONCURRENCY",
      "service": "Worker",
      "description": "Bounded process concurrency, integer 1-4; default 2 with an eight-connection pool.",
      "secret": false,
      "strategy": "default",
      "default": "2"
    },
    {
      "key": "PORT",
      "service": "Dashboard",
      "description": "Internal listener/probe target port; do not expose private services.",
      "secret": false,
      "strategy": "default",
      "default": "3000"
    },
    {
      "key": "DATABASE_URL",
      "service": "Dashboard",
      "description": "Direct private PostgreSQL connection using service references; no public database endpoint.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "DASHBOARD_PUBLIC_ORIGIN",
      "service": "Dashboard",
      "description": "HTTPS public dashboard origin for upstream host/origin protection.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "WORKHORSE_DASHBOARD_PASSWORD",
      "service": "Dashboard",
      "description": "Generated administrator password (minimum 16 characters); hashed in memory before authentication.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "WORKHORSE_DASHBOARD_USERNAME",
      "service": "Dashboard",
      "description": "Single read-only operator username.",
      "secret": false,
      "strategy": "default",
      "default": "operator"
    },
    {
      "key": "PORT",
      "service": "Postgres",
      "description": "Internal listener/probe target port; do not expose private services.",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "PGDATA",
      "service": "Postgres",
      "description": "PostgreSQL cluster subdirectory on its exclusive volume.",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "POSTGRES_DB",
      "service": "Postgres",
      "description": "Durable queue database name.",
      "secret": false,
      "strategy": "default",
      "default": "workhorse"
    },
    {
      "key": "POSTGRES_USER",
      "service": "Postgres",
      "description": "Database owner for schema installation; isolate from other applications.",
      "secret": false,
      "strategy": "default",
      "default": "workhorse"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "Postgres",
      "description": "Generated alphanumeric database credential, referenced by applications.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "workhorse-postgresql-queue"
      }
    },
    "cli": "railway deploy --template workhorse-postgresql-queue",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "37cf01a6-4b98-410b-b096-d306b6207e4b",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "2880ee6a-949b-49b2-8d62-8c29e99d6298": {
                  "icon": null,
                  "name": "Worker",
                  "build": {
                    "builder": "DOCKERFILE",
                    "dockerfilePath": "Dockerfile"
                  },
                  "deploy": {
                    "startCommand": "node app/worker.mjs",
                    "healthcheckPath": "/readyz",
                    "preDeployCommand": [
                      "node app/install.mjs"
                    ],
                    "healthcheckTimeout": 180
                  },
                  "source": {
                    "repo": "tech-progress/workhorse-postgres-queue",
                    "branch": "release-v1",
                    "rootDirectory": "/"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Internal listener/probe target port; do not expose private services.",
                      "defaultValue": "3000"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "Direct private PostgreSQL connection using service references; no public database endpoint.",
                      "defaultValue": "postgresql://${{Postgres.POSTGRES_USER}}:${{Postgres.POSTGRES_PASSWORD}}@${{Postgres.RAILWAY_PRIVATE_DOMAIN}}:5432/${{Postgres.POSTGRES_DB}}"
                    },
                    "WORKER_CONCURRENCY": {
                      "isOptional": false,
                      "description": "Bounded process concurrency, integer 1-4; default 2 with an eight-connection pool.",
                      "defaultValue": "2"
                    }
                  },
                  "networking": {
                    "tcpProxies": {},
                    "customDomains": {},
                    "serviceDomains": {}
                  },
                  "volumeMounts": {}
                },
                "cf911631-fd18-4819-9dcb-8439b00bc7e8": {
                  "icon": null,
                  "name": "Dashboard",
                  "build": {
                    "builder": "DOCKERFILE",
                    "dockerfilePath": "Dockerfile"
                  },
                  "deploy": {
                    "startCommand": "node app/dashboard.mjs",
                    "healthcheckPath": "/readyz",
                    "healthcheckTimeout": 180
                  },
                  "source": {
                    "repo": "tech-progress/workhorse-postgres-queue",
                    "branch": "release-v1",
                    "rootDirectory": "/"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Internal listener/probe target port; do not expose private services.",
                      "defaultValue": "3000"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "Direct private PostgreSQL connection using service references; no public database endpoint.",
                      "defaultValue": "postgresql://${{Postgres.POSTGRES_USER}}:${{Postgres.POSTGRES_PASSWORD}}@${{Postgres.RAILWAY_PRIVATE_DOMAIN}}:5432/${{Postgres.POSTGRES_DB}}"
                    },
                    "DASHBOARD_PUBLIC_ORIGIN": {
                      "isOptional": false,
                      "description": "HTTPS public dashboard origin for upstream host/origin protection.",
                      "defaultValue": "https://${{Dashboard.RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "WORKHORSE_DASHBOARD_PASSWORD": {
                      "isOptional": false,
                      "description": "Generated administrator password (minimum 16 characters); hashed in memory before authentication.",
                      "defaultValue": "{{WORKHORSE_DASHBOARD_PASSWORD}}"
                    },
                    "WORKHORSE_DASHBOARD_USERNAME": {
                      "isOptional": false,
                      "description": "Single read-only operator username.",
                      "defaultValue": "operator"
                    }
                  },
                  "networking": {
                    "tcpProxies": {},
                    "customDomains": {},
                    "serviceDomains": {
                      "<hasDomain>": {
                        "port": 3000
                      }
                    }
                  },
                  "volumeMounts": {}
                },
                "edb11aeb-d1fc-4d5e-b148-c95b76259c51": {
                  "icon": null,
                  "name": "Postgres",
                  "deploy": {},
                  "source": {
                    "image": "postgres:17.11-bookworm@sha256:639ab7ceb90e13123085b741fb31ef493fba25463002f6da665352e7b534b652"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Internal listener/probe target port; do not expose private services.",
                      "defaultValue": "5432"
                    },
                    "PGDATA": {
                      "isOptional": false,
                      "description": "PostgreSQL cluster subdirectory on its exclusive volume.",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Durable queue database name.",
                      "defaultValue": "workhorse"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "Database owner for schema installation; isolate from other applications.",
                      "defaultValue": "workhorse"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Generated alphanumeric database credential, referenced by applications.",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    }
                  },
                  "networking": {
                    "tcpProxies": {},
                    "customDomains": {},
                    "serviceDomains": {}
                  },
                  "volumeMounts": {
                    "edb11aeb-d1fc-4d5e-b148-c95b76259c51": {
                      "sizeMB": 5000,
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "Dashboard",
      "method": "GET",
      "path": "/readyz",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 3,
    "needs_volume": true
  },
  "generated_at": "2026-10-04T16:14:45.452Z",
  "generator_version": "0.1.0",
  "status": "degraded",
  "validated_at": "2026-10-04T16:17:43.071Z",
  "success_rate_30d": 0,
  "validation": {
    "last_run_id": "run_2a5e708fe8a94547b3da",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": false,
        "detail": "BUILDING,FAILED,SUCCESS"
      }
    ]
  }
}
