## Host Approval Workflow with Spring Boot: Relational Workspace Data

### Summary
Deploy an approval workflow built with Spring Boot on Ample using the relational records pattern. Compute runs the app in an isolated microVM behind a public HTTPS URL, a managed PostgreSQL 16 database is auto-provisioned and injected as DATABASE_URL. Verified on Spring Boot: a workspace-scoped table, an explicit state machine (draft to review to published) that rejects invalid transitions, and a cross-workspace read that returns nothing (transitions=true isolation=true). Not separately tested: your record schema, states and access rules; treat the approval workflow-specific behavior as your application code.

### Representative Queries
- Host approval workflow with Spring Boot: relational workspace data
- Where can I host Approval workflow built with Spring Boot?
- I need a workspace-specific schema, state transitions and access rules.

### Resource Requirements
- **Compute**
- **Postgres**

### Infrastructure Requirements
1. **Compute**  
   - Status: verified  
   - Summary: Apps run in isolated x86_64 Firecracker microVMs that auto-pause when idle and wake on request; sizes are the priced VM sizes.
2. **Postgres**  
   - Status: verified  
   - Summary: Managed PostgreSQL 16 runs in its own microVM and is auto-provisioned when an app needs a database and no DATABASE_URL is supplied.

### Framework
Spring Boot

### Workload
Approval workflow

### Release Status
Published

### Support Status
Verified

### Execution Status
Ready

### Prerequisites
- A Spring Boot project that builds and starts with the documented commands (./mvnw -q -DskipTests package or the Gradle wrapper producing one application jar, then java -jar on the jvm-21 template with server.port read from PORT)
- A PostgreSQL driver reading DATABASE_URL at runtime (auto-provisioned when omitted, or supplied with --env)
- An Ample account token with servers:write, databases:read

### Tested Configuration
- **Template**: jvm-21  
- **Runtime**: java  
- **Size**: s-1vcpu-2gb  
- **Build Command**: ./mvnw -q -DskipTests package  
- **Start Command**: java -jar $(ls target/*.jar | grep -v -- '-plain' | head -n 1)

### Input Schema
- **Name**: App name (maxLength: 63)
- **Path**: Project directory or ample.toml service (maxLength: 512)
- **Env**: Encrypted environment variables (bucket credentials, secrets)  
  - Max items: 50
  - Pattern: ^[A-Z][A-Z0-9_]*=.*$
- **Release Command**: Migration command run before activation (maxLength: 512)

### Workflow Steps
1. **Build and Start**  
   Run `./mvnw -q -DskipTests package` (or the Gradle wrapper) producing one application jar, then `java -jar` on the jvm-21 template with server.port read from PORT.
2. **Implement the Pattern on PostgreSQL**  
   The fixture's module implements relational records: a workspace-scoped table, an explicit state machine (draft to review to published) that rejects invalid transitions, and a cross-workspace read that returns nothing.
3. **Deploy**  
   Run the synchronous deploy once and read the result.
4. **Verify**  
   Fetch the live URL and run your own checks.

### Success Checks
1. App responds on its public URL
2. Relational records self-test

### Limitations
- Verified on the jvm-21 template at s-1vcpu-2gb with the example fixture.

### Cost Estimate
- **Currency**: USD  
- **Monthly Amount**: 10.0  
  - App server, size: s-1vcpu-1gb, quantity: 1.0, monthly amount: 5.0
  - Managed PostgreSQL database, size: s-1vcpu-1gb, quantity: 1.0, monthly amount: 5.0
  
### Evidence Summary
- **Summary**: Spring Boot pattern fixture deployed successfully on Ample; checks passed for relational records and configuration secrets.
- **Observed At**: 2026-09-21T02:34:39Z

### Formats
- **HTML**: [link](/content/recipes/approval-workflow/spring-boot/relational-workspace/index.html)  
- **Markdown**: [link](/content/recipes/approval-workflow/spring-boot/relational-workspace.md)  
- **JSON**: [link](https://api.ample.computer/v1/catalog/recipes/page%3Arecipes%3Aapproval-workflow%3Aspring-boot%3Arelational-workspace)

### Next Actions
1. **Browse the catalog index**  
2. **Search published recipes by intent, stack and constraints**  
3. **Prepare a side-effect-free deployment plan for an authorized project**
