{
  "manifest_version": "1.0.0",
  "template": {
    "id": "d9a890ee-3fd2-40d5-91e5-90f897ca6856",
    "slug": "kestra-orchestration-postgres",
    "name": "Kestra Orchestration + Postgres",
    "description": "Kestra orchestration with Postgres, declarative YAML workflows",
    "url": "https://railway.com/deploy/kestra-orchestration-postgres",
    "upstream": {
      "image": "kestra/kestra:v2.0.2-slim"
    }
  },
  "services": [
    {
      "name": "Postgres",
      "source": {
        "image": "ghcr.io/railwayapp-templates/postgres-ssl:17"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "tcp_ports": [
        5432
      ],
      "http": false
    },
    {
      "name": "Kestra",
      "source": {
        "image": "kestra/kestra:v2.0.2-slim"
      },
      "needs_volume": true,
      "volume_mount_path": "/app/storage",
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "PGDATA",
      "service": "Postgres",
      "description": "Provide a value for PGDATA.",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "PGHOST",
      "service": "Postgres",
      "description": "Provide a value for PGHOST.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PGPORT",
      "service": "Postgres",
      "description": "Provide a value for PGPORT.",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "PGUSER",
      "service": "Postgres",
      "description": "Provide a value for PGUSER.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGDATABASE",
      "service": "Postgres",
      "description": "Provide a value for PGDATABASE.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGPASSWORD",
      "service": "Postgres",
      "description": "Provide a value for PGPASSWORD.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_DB",
      "service": "Postgres",
      "description": "Database name.",
      "secret": false,
      "strategy": "default",
      "default": "kestra"
    },
    {
      "key": "DATABASE_URL",
      "service": "Postgres",
      "description": "Private-network connection string (IPv6, includes port).",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_USER",
      "service": "Postgres",
      "description": "Database superuser.",
      "secret": false,
      "strategy": "default",
      "default": "kestra"
    },
    {
      "key": "SSL_CERT_DAYS",
      "service": "Postgres",
      "description": "Provide a value for SSL_CERT_DAYS.",
      "secret": false,
      "strategy": "default",
      "default": "820"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "Postgres",
      "description": "Generated database password.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "DATABASE_PUBLIC_URL",
      "service": "Postgres",
      "description": "Public URL via the TCP proxy (for psql / GUI clients).",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "DATABASE_PRIVATE_URL",
      "service": "Postgres",
      "description": "Provide a value for DATABASE_PRIVATE_URL.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "Postgres",
      "description": "Provide a value for RAILWAY_DEPLOYMENT_DRAINING_SECONDS.",
      "secret": false,
      "strategy": "default",
      "default": "60"
    },
    {
      "key": "PORT",
      "service": "Kestra",
      "description": "Kestra webserver port. Railway's healthcheck and edge proxy probe $PORT, so keep this equal to MICRONAUT_SERVER_PORT.",
      "secret": false,
      "strategy": "default",
      "default": "8080"
    },
    {
      "key": "KESTRA_URL",
      "service": "Kestra",
      "description": "Public base URL (kestra.url). Used for absolute links in the UI and in notification tasks.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "RAILWAY_RUN_UID",
      "service": "Kestra",
      "description": "The Kestra image runs as the non-root kestra user while Railway mounts volumes as root. Running as root lets Kestra write /app/storage, which is what the upstream compose file does too.",
      "secret": false,
      "strategy": "default",
      "default": "0"
    },
    {
      "key": "KESTRA_CONFIGURATION",
      "service": "Kestra",
      "description": "Inline Kestra YAML configuration. Sets the Postgres datasource, the Postgres repository and queue, local internal storage at /app/storage, and basic auth. Edit this to add storage backends, secrets managers or plugin settings.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "KESTRA_ADMIN_PASSWORD",
      "service": "Kestra",
      "description": "Generated basic auth password. Kestra requires at least 8 characters with an uppercase letter, a lowercase letter and a digit, which the Kestra1 prefix guarantees.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "KESTRA_ADMIN_USERNAME",
      "service": "Kestra",
      "description": "Basic auth login for the UI and the REST API. Kestra validates this as an email address, so keep the user@domain form.",
      "secret": false,
      "strategy": "default",
      "default": "admin@kestra.local"
    },
    {
      "key": "MICRONAUT_SERVER_PORT",
      "service": "Kestra",
      "description": "Port Micronaut binds. Micronaut does not read PORT by itself, so it is pinned to the same value Railway probes.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "KESTRA_TUTORIAL_FLOWS_ENABLED",
      "service": "Kestra",
      "description": "Loads Kestra's tutorial flows on first start. Set to false for a faster, quieter first boot.",
      "secret": false,
      "strategy": "default",
      "default": "true"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "kestra-orchestration-postgres"
      }
    },
    "cli": "railway deploy --template kestra-orchestration-postgres",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "d9a890ee-3fd2-40d5-91e5-90f897ca6856",
            "serializedConfig": {
              "services": {
                "71cc11d9-5043-486c-8e8d-e7f4e1c3eab7": {
                  "icon": "https://devicons.railway.app/i/postgresql.svg",
                  "name": "Postgres",
                  "build": {},
                  "deploy": {
                    "requiredMountPath": "/var/lib/postgresql/data"
                  },
                  "source": {
                    "image": "ghcr.io/railwayapp-templates/postgres-ssl:17"
                  },
                  "variables": {
                    "PGDATA": {
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "PGHOST": {
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "PGPORT": {
                      "defaultValue": "5432"
                    },
                    "PGUSER": {
                      "defaultValue": "${{POSTGRES_USER}}"
                    },
                    "PGDATABASE": {
                      "defaultValue": "${{POSTGRES_DB}}"
                    },
                    "PGPASSWORD": {
                      "defaultValue": "${{POSTGRES_PASSWORD}}"
                    },
                    "POSTGRES_DB": {
                      "description": "Database name.",
                      "defaultValue": "kestra"
                    },
                    "DATABASE_URL": {
                      "description": "Private-network connection string (IPv6, includes port).",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:5432/${{PGDATABASE}}"
                    },
                    "POSTGRES_USER": {
                      "description": "Database superuser.",
                      "defaultValue": "kestra"
                    },
                    "SSL_CERT_DAYS": {
                      "isOptional": true,
                      "defaultValue": "820"
                    },
                    "POSTGRES_PASSWORD": {
                      "description": "Generated database password.",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "DATABASE_PUBLIC_URL": {
                      "description": "Public URL via the TCP proxy (for psql / GUI clients).",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_TCP_PROXY_DOMAIN}}:${{RAILWAY_TCP_PROXY_PORT}}/${{PGDATABASE}}"
                    },
                    "DATABASE_PRIVATE_URL": {
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:5432/${{PGDATABASE}}"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": true,
                      "defaultValue": "60"
                    }
                  },
                  "networking": {
                    "tcpProxies": {
                      "5432": {}
                    },
                    "serviceDomains": {}
                  },
                  "volumeMounts": {
                    "7589de79-d635-44b9-b753-4c4523ed34ad": {
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  }
                },
                "db973389-b04c-474b-9f57-f563ba2c2378": {
                  "icon": "https://raw.githubusercontent.com/kestra-io/kestra/v2.0.2/ui/src/assets/logo-small.png",
                  "name": "Kestra",
                  "build": {},
                  "deploy": {
                    "startCommand": "/usr/local/bin/docker-entrypoint.sh server standalone",
                    "healthcheckPath": "/ping",
                    "requiredMountPath": "/app/storage",
                    "restartPolicyType": "ON_FAILURE",
                    "healthcheckTimeout": 600,
                    "restartPolicyMaxRetries": 5
                  },
                  "source": {
                    "image": "kestra/kestra:v2.0.2-slim"
                  },
                  "variables": {
                    "PORT": {
                      "description": "Kestra webserver port. Railway's healthcheck and edge proxy probe $PORT, so keep this equal to MICRONAUT_SERVER_PORT.",
                      "defaultValue": "8080"
                    },
                    "KESTRA_URL": {
                      "description": "Public base URL (kestra.url). Used for absolute links in the UI and in notification tasks.",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}/"
                    },
                    "RAILWAY_RUN_UID": {
                      "description": "The Kestra image runs as the non-root kestra user while Railway mounts volumes as root. Running as root lets Kestra write /app/storage, which is what the upstream compose file does too.",
                      "defaultValue": "0"
                    },
                    "KESTRA_CONFIGURATION": {
                      "description": "Inline Kestra YAML configuration. Sets the Postgres datasource, the Postgres repository and queue, local internal storage at /app/storage, and basic auth. Edit this to add storage backends, secrets managers or plugin settings.",
                      "defaultValue": "datasources:\n  postgres:\n    url: jdbc:postgresql://${{Postgres.RAILWAY_PRIVATE_DOMAIN}}:5432/${{Postgres.POSTGRES_DB}}\n    driverClassName: org.postgresql.Driver\n    username: \"${{Postgres.POSTGRES_USER}}\"\n    password: \"${{Postgres.POSTGRES_PASSWORD}}\"\nkestra:\n  repository:\n    type: postgres\n  queue:\n    type: postgres\n  storage:\n    type: local\n    local:\n      base-path: \"/app/storage\"\n  server:\n    basic-auth:\n      username: \"${{KESTRA_ADMIN_USERNAME}}\"\n      password: \"${{KESTRA_ADMIN_PASSWORD}}\"\n"
                    },
                    "KESTRA_ADMIN_PASSWORD": {
                      "description": "Generated basic auth password. Kestra requires at least 8 characters with an uppercase letter, a lowercase letter and a digit, which the Kestra1 prefix guarantees.",
                      "defaultValue": "{{KESTRA_ADMIN_PASSWORD}}"
                    },
                    "KESTRA_ADMIN_USERNAME": {
                      "description": "Basic auth login for the UI and the REST API. Kestra validates this as an email address, so keep the user@domain form.",
                      "defaultValue": "admin@kestra.local"
                    },
                    "MICRONAUT_SERVER_PORT": {
                      "description": "Port Micronaut binds. Micronaut does not read PORT by itself, so it is pinned to the same value Railway probes.",
                      "defaultValue": "${{PORT}}"
                    },
                    "KESTRA_TUTORIAL_FLOWS_ENABLED": {
                      "isOptional": true,
                      "description": "Loads Kestra's tutorial flows on first start. Set to false for a faster, quieter first boot.",
                      "defaultValue": "true"
                    }
                  },
                  "networking": {
                    "tcpProxies": {},
                    "serviceDomains": {
                      "kestra-dom": {
                        "port": 8080
                      }
                    }
                  },
                  "volumeMounts": {
                    "2afcb90a-9ec4-4634-8c8c-c926dd82781f": {
                      "mountPath": "/app/storage"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "Kestra",
      "method": "GET",
      "path": "/ping",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 2,
    "needs_volume": true
  },
  "generated_at": "2026-09-21T04:14:46.774Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-21T02:19:43.758Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_99705476bfde418eaf77",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "healthcheck",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 58,
    "typical_build_seconds": 0,
    "typical_start_seconds": 10,
    "slowest_service": "Kestra"
  }
}
