conductor-sdk-js
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Conductor Javascript SDK

This project provides client SDKs to interact with Netflix and Orkes conductor servers.

Quick Start

  1. Setup
  2. Create and run Task Workers
  3. Create workflows using Code
  4. Api Docs

Setup conductor

Simple connection to conductor

const { ConductorClient } = require ("conductor-sdk-js");

const client = new ConductorClient({
  serverUrl: "http://localhost:8080/api",
});

Using Worker

const { ConductorClient, TaskManager } = require("conductor-sdk-js");
const client = new ConductorClient({
  serverUrl: "http://localhost:8080/api",
});

const worker = {
  taskDefName: "simple_worker",
  execute: async ({ inputData }) => {
    return {
      outputData: {
        ...inputData,
        hello: "From your worker",
      },
      status: "COMPLETED",
    };
  },
};

const workers = [worker];
const taskManager = new TaskManager(client, workers);

taskManager.startPolling();
console.log("Worker Polling Task -> simple_worker");

Connect to conductor using Orkes

/**
 * Application keys generated from the Application menu > Create Application
 * then edit and create Access Keys
 *
 */
const { OrkesApiConfig, orkesConductorClient } = require ("conductor-sdk-js");

const config: Partial<OrkesApiConfig> = {
  keyId: "XXX",
  keySecret: "XXXX",
  serverUrl: "http://localhost:8080/api",
};

orkesConductorClient(config).then(client => ..... );

Install

Homepage

orkes.io

DownloadsWeekly Downloads

1

Version

1.0.0

License

Apache-2.0

Unpacked Size

1.28 MB

Total Files

8

Last publish

Collaborators

  • crivasf22