page:recipes:ai workflow runner:hono:response streaming
Host AI Workflow Runner with Hono: Streamed Responses
Deploy an AI workflow runner built with Hono on Ample using the streaming response service 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 Hono: a Server-Sent Events endpoint read incrementally through the public HTTPS gateway: five one-second chunks arrived spread over time with the first within seconds (not buffered), a 70-second stream of 36 chunks completed past common 60-second idle timeouts, and a client that disconnected after two chunks was observed and recorded by the server (disconnected=true).
Summary of Observations:
- Streaming Response Behavior: 70-second stream with multiple chunks delivered incrementally.
- Client Handling: Disconnected successfully captured by the server.
Representative Queries
- Host AI workflow runner with Hono: streamed responses
- Where can I host AI workflow runner built with Hono?
- I need a tested end-to-end streaming transport, timeout behavior and client disconnect handling.
Resource Requirements
- Compute: AI workflow runner needs compute resources.
- Postgres: Managed PostgreSQL is required.
Infrastructure Requirements
Compute
- Status: Verified
- Summary: Apps run in isolated x86_64 Firecracker microVMs that auto-pause when idle and wake on request.
Postgres
- Status: Verified
- Summary: Managed PostgreSQL 16 runs in its own microVM and is auto-provisioned when needed.
Prerequisites
- A Hono project that builds and starts with the documented commands.
- A PostgreSQL driver reading DATABASE_URL at runtime.
- An Ample account token with necessary permissions.
Workflow Steps
Build and Start
- Command:
npm install and npm run start with @hono/node-server on the node-22 template - Requirement: Server must bind to 0.0.0.0 on PORT.
- Command:
Implement the Pattern on PostgreSQL
- Implement the streaming response service and repeat the data delivery schema.
Deploy
- Command:
ample deploy . --name --public - Perform synchronous deployment and check results.
- Command:
Verify
- Command:
ample logs --kind build - Fetch and verify the live URL and self-test routes.
- Command:
Examples
- Hono Pattern Fixture: Multi-pattern Hono app showcasing streaming response service.
Success Checks
- App responds on its public URL.
- Streaming response service self-test runs successfully.
Limitations
- Verified on specific template and virtual machine sizes.
- Some aspects of the custom application code were not tested separately.
Cost Estimate
- Monthly Amount: $10.00
- Breakdown:
- App server: $5.00
- Managed PostgreSQL database: $5.00
Next Actions
- Browse the catalog index.
- Search published recipes by intent, stack, and constraints.
- Prepare a deployment plan for an authorized project.