Skip to content

Commit 7c4546b

Browse files
committed
👌 IMPROVE: example
1 parent 3e63082 commit 7c4546b

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

examples/nodejs/workflows/workflows.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
// Test script for the simplified proxy approach
21
import 'dotenv/config';
3-
import {Langbase} from 'langbase';
2+
import {Langbase, Workflow} from 'langbase';
43

54
// Create Langbase instance
65
const langbase = new Langbase({
@@ -10,9 +9,15 @@ const langbase = new Langbase({
109
async function main() {
1110
// Create a workflow with debug mode enabled
1211
const workflow = langbase.workflow({
13-
name: 'simplified-proxy-test',
14-
debug: true, // Enable debug logging
12+
name: 'Test Agent Workflow',
13+
debug: true,
1514
});
15+
// OR
16+
// const workflow = new Workflow({
17+
// name: 'Test Agent Workflow',
18+
// debug: true,
19+
// langbase,
20+
// });
1621

1722
try {
1823
// STEP 1: Call langbase.agent.run but don't return its result directly
@@ -76,7 +81,7 @@ async function main() {
7681
} catch (error) {
7782
console.error('❌ Workflow error:', error);
7883
} finally {
79-
// End the workflow to show trace report
84+
// End the workflow to send trace
8085
workflow.end();
8186
}
8287
}

0 commit comments

Comments
 (0)