Approval Workflow Lab
Draft - pending - approve/reject via opaque tokens. Neon/memory state machine with honest fallbacks.
Run this experiment yourself
Demos are not embedded on this site. Deploy a standalone copy on Vercel or run the experiment app locally.
Local development
cd apps/experiments/approval-workflow-lab pnpm install pnpm dev
Then open http://localhost:3010.
This is an experimental demo. Use it as a starting point for your own projects.
Approval Workflow Lab is a Wave 3 Batch H composition lab. Pure helpers live in logic.ts; missing providers or stores degrade honestly (never fabricate AI output).
Features
- State machine: draft - pending - approved|rejected
- Opaque approve/reject tokens
- Neon or in-memory persistence
API Reference
POST /api/workflow · POST /api/decide · GET /api/workflow
{ "title": "Ship pricing page", "body": "…" }| Status | Cause |
|---|---|
200 | Success |
400 | Invalid transition / missing fields |
404 | Unknown item or token |
Implementation Details
Validate
Inputs are length-capped in logic.ts; APIs return 400 for missing fields.
Run
Route Handlers compose AI SDK, Redis/Neon, or ImageResponse as documented. Fallbacks include honest notes.
Limitations
- Not a production IAM / SSO system.
- No email delivery of tokens.
- Memory mode resets on cold start.
Use in your project
Copy the Route Handler(s) and logic.ts from apps/experiments/approval-workflow-lab/.
Deployment
Local Development
cd apps/experiments/approval-workflow-lab
pnpm install
pnpm devConfiguration
| Variable | Required | Purpose |
|---|---|---|
DATABASE_URL | No | Neon persistence |