Skip to content

Commit 8bc30eb

Browse files
committed
📦 NEW: cf worker
1 parent 78e23ba commit 8bc30eb

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# CF Worker Ecosystem Test
2+
3+
This test runs a minimal workflow using `[email protected]` in a Cloudflare Worker environment.
4+
5+
## How to Run
6+
7+
- Install dependencies: `npm install`
8+
- Deploy or run locally using a tool like `wrangler`.
9+
10+
The entrypoint is `index.ts`.

ecosystem-tests/cf-worker/index.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import {Workflow} from 'langbase';
2+
3+
export default {
4+
async fetch(request: Request) {
5+
// Simple workflow step
6+
const workflow = new Workflow({debug: true});
7+
const result = await workflow.step({
8+
id: 'hello',
9+
run: async () => 'world',
10+
});
11+
return new Response(JSON.stringify({result}), {
12+
headers: {'content-type': 'application/json'},
13+
});
14+
},
15+
};
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "cf-worker-test",
3+
"version": "1.0.0",
4+
"type": "module",
5+
"private": true,
6+
"dependencies": {
7+
"langbase": "1.2.0"
8+
}
9+
}

0 commit comments

Comments
 (0)