-
Notifications
You must be signed in to change notification settings - Fork 371
Open
Description
Topic
How to work with or execute a pre-generated workflow?
Details
import { Eko } from "@eko-ai/eko";
import { BrowserAgent, FileAgent } from "@eko-ai/eko-nodejs";
import fs from 'fs/promises';
const llms = {
default: {
provider: "google",
model: "gemini-2.0-flash",
apiKey: "MYKEY" // replace with your real API key
}
};
async function run() {
const agents = [new BrowserAgent(), new FileAgent()];
const eko = new Eko({ llms, agents });
const browserAgent = new BrowserAgent();
const fileAgent = new FileAgent();
# first
const prompt = '....'
const plan = await eko.generate(prompt);
await fs.writeFile('workflow.json', JSON.stringify(plan, null, 2), 'utf-8');
console.log("Workflow saved to workflow.json");
# and then
const workflowData = await fs.readFile('workflow.json', 'utf-8');
const myWorkflow = JSON.parse(workflowData);
const result = await eko.execute(myWorkflow);
# but it always throws
# Error: The task does not exist
}
run().catch(console.error);
Additional Context
No response
Metadata
Metadata
Assignees
Labels
No labels