File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -310,18 +310,20 @@ Conductor picks up from the failed task, reusing the outputs of all previously c
310310 === "JavaScript"
311311
312312 ```javascript
313- const { ConductorWorker } = require("@conductor-oss/conductor-client");
314-
315- const worker = new ConductorWorker({
316- url: "http://localhost:8080/api",
317- });
318-
319- worker.register("process_result", async (task) => {
320- const { summary, randomValue } = task.inputData;
321- return { result: summary.toUpperCase(), doubled: randomValue * 2 };
322- });
323-
324- worker.start();
313+ const { OrkesClients, TaskHandler } = require("@io-orkes/conductor-javascript");
314+
315+ async function main() {
316+ const clients = await OrkesClients.from({ serverUrl: "http://localhost:8080/api" });
317+ const handler = new TaskHandler(clients, [{
318+ taskDefName: "process_result",
319+ execute: async (task) => {
320+ const { summary, randomValue } = task.inputData;
321+ return { outputData: { result: summary.toUpperCase(), doubled: randomValue * 2 }, status: "COMPLETED" };
322+ },
323+ }]);
324+ handler.startPolling();
325+ }
326+ main();
325327 ```
326328
327329 See the [JavaScript SDK](https://github.com/conductor-oss/javascript-sdk) for full setup.
You can’t perform that action at this time.
0 commit comments