All Projects → zenaton → zenaton-node

zenaton / zenaton-node

Licence: MIT license
⚡ Node.js library to run and orchestrate background jobs with Zenaton Workflow Engine

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to zenaton-node

zenaton-ruby
💎 Ruby gem to run and orchestrate background jobs with Zenaton Workflow Engine
Stars: ✭ 32 (-36%)
Mutual labels:  workflow-engine, orchestration, queues, job-orchestration, queuing-system
sdk-java
Temporal Java SDK
Stars: ✭ 117 (+134%)
Mutual labels:  workflow-engine, orchestration, workflow-automation
theeye-of-sauron
TheEye Dockers and QuickStart
Stars: ✭ 27 (-46%)
Mutual labels:  workflow-engine, jobs, workflow-automation
Cylc Flow
Cylc: a workflow engine for cycling systems. Repository master branch: core meta-scheduler component of cylc-8 (in development); Repository 7.8.x branch: full cylc-7 system.
Stars: ✭ 154 (+208%)
Mutual labels:  workflow-engine, scheduler
Prefect
The easiest way to automate your data
Stars: ✭ 7,956 (+15812%)
Mutual labels:  workflow-engine, orchestration
Server
The Prefect API and backend
Stars: ✭ 87 (+74%)
Mutual labels:  workflow-engine, orchestration
Flask Rq2
A Flask extension for RQ.
Stars: ✭ 176 (+252%)
Mutual labels:  scheduler, jobs
micronaut-camunda-bpm
Integration between Micronaut and Camunda (Workflow Engine). We configure Camunda with sensible defaults, so that you can get started with minimum configuration: simply add a dependency in your Micronaut project to embed the workflow engine!
Stars: ✭ 73 (+46%)
Mutual labels:  workflow-engine, process
Aiida Core
The official repository for the AiiDA code
Stars: ✭ 238 (+376%)
Mutual labels:  workflow-engine, scheduler
postier
Postier is a Laravel API automation platform to transfer data and to sync apps. You can build workflows with data and actions of multiple apps and apply logics to the data!
Stars: ✭ 55 (+10%)
Mutual labels:  workflow-engine, workflow-automation
bpxe
Business Process eXecution Engine
Stars: ✭ 36 (-28%)
Mutual labels:  engine, workflow-engine
chronus
Chronus是360数科技术团队基于阿里开源项目TBSchedule重写的分布式调度。
Stars: ✭ 174 (+248%)
Mutual labels:  scheduler, jobs
Couler
Unified Interface for Constructing and Managing Workflows on different workflow engines, such as Argo Workflows, Tekton Pipelines, and Apache Airflow.
Stars: ✭ 405 (+710%)
Mutual labels:  workflow-engine, scheduler
Odin
A programmable, observable and distributed job orchestration system.
Stars: ✭ 405 (+710%)
Mutual labels:  workflow-engine, orchestration
Temporal
Temporal service
Stars: ✭ 3,212 (+6324%)
Mutual labels:  workflow-engine, workflow-automation
mira
Qlik Associative Engine discovery service for orchestrated environments.
Stars: ✭ 13 (-74%)
Mutual labels:  engine, orchestration
Workq
Job server in Go
Stars: ✭ 1,546 (+2992%)
Mutual labels:  scheduler, jobs
Chronus
Chronus是360金融技术团队基于阿里开源项目TBSchedule重写的分布式调度。
Stars: ✭ 166 (+232%)
Mutual labels:  scheduler, jobs
lightflow
A lightweight, distributed workflow system
Stars: ✭ 67 (+34%)
Mutual labels:  workflow-engine, workflow-automation
joobq
JoobQ is a fast, efficient asynchronous reliable job queue and job scheduler library processing. Jobs are submitted to a job queue, where they reside until they are able to be scheduled to run in a computing environment.
Stars: ✭ 26 (-48%)
Mutual labels:  scheduler, jobs

⚠️ This repository is abandoned.


Build and run event-driven processes within the product journey in days instead of months.
ie. payment, booking, personalized communication sequences, ETL processes and more. Explore the docs »
Website · Examples in Node · Tutorial in Node

NPM Version CircleCI License

Note: This library can be used both as:

  • a sdk to interact with workflows from your Node.js app
  • a sdk to build workflows.

Zenaton library for Node.js

Zenaton helps developers to easily build asynchronous workflows.

Build workflows using Zenaton functions to build control flows around your business logic and tasks - managing time, events and external services within one class. Functions include 'wait for a specific time or event', 'react to external events', 'run parallel tasks, 'create schedules' and more all by writing one line of code. More about Zenaton Functions

Key capabilities:

  • Standalone Tasks - dispatch or schedule an asynchronous business job with just one line of code.
  • Workflows as code - Combine Zenaton functions and Node.js to create infinite possibilities of logic.
  • Real-time Monitoring - Get a real-time view of workers and tasks - scheduled, processing and executed.
  • Scheduler - Schedule recurrent tasks and workflows and automatically retry tasks that fail or get alerts when there are errors or timeouts.
  • Error Handling: - Alerts for errors and timeouts and retry, resume or kill processes. React to errors by writing logic into workflow code to trigger retries or other actions.

You can sign up for an account on Zenaton and go through the tutorial in Node.

Node Documentation

You can find all the details on Zenaton's website.

Requirements

Node 8 and later.

Table of contents

Getting started

Installation

Install the Zenaton Agent

To install the Zenaton agent, run the following command:

curl https://install.zenaton.com/ | sh

Install the library

To add the latest version of the library to your project, run the following command:

npm install zenaton --save

TypeScript typings

For Typescript developers:

npm install @types/zenaton --save-dev

Quick start

Client Initialization

To start, you need to initialize the client. To do this, you need your Application ID and API Token. You can find both on your Zenaton account.

Then, initialize your Zenaton client:

/* client.js */

const { Client } = require("zenaton");

module.exports = new Client(
  "<YourApplicationId>",
  "<YourApiToken>",
  "<YourApplicationEnv>", // Use "dev" as default
);

Boot file

The next step is to have your Zenaton Agent listen to your application.

The Agent needs to be pointed to a boot file which will allow it to figure out where tasks or workflows are located when the time comes to run them.

/* boot.js */

const { task, workflow } = require("zenaton");

// define tasks (example)
task("hello_world_task", require("./tasks/HelloWorldTask"));

// define workflows (example)
workflow("my_first_workflow", require("./workflows/MyFirstWorkflow"));

To run the listen command:

zenaton listen --app_id=<YourApplicationId> --api_token=<YourApiToken> --app_env=<YourApplicationEnv> --boot=boot.js

Executing a background job

A job in Zenaton is created through the task function.

Let's start by implementing a first task printing something, and returning a value:

/* tasks/HelloWorldTask.js */
module.exports.handle = async function(name = "World") {
  return `Hello ${name}`!;
};

Now, when you want to run this task as a background job, you need to do the following:

/* launchHelloWorldTask.js */
const { run } = require("./client.js");

run.task("hello_world_task", "Me");

That's all you need to get started. With this, you can run many background jobs. However, the real power of Zenaton is to be able to orchestrate these jobs. The next section will introduce you to job orchestration.

Orchestrating background jobs

Job orchestration is what allows you to write complex business workflows simply. You can execute jobs sequentially, in parallel, conditionally based on the result of a previous job, and you can even use loops to repeat some tasks.

We wrote about some use-cases of job orchestration, you can take a look at these articles to see how people use job orchestration.

Using workflows

A workflow in Zenaton is created through the workflow function.

We will implement a very simple workflow that will execute sequentially the hello_world_task 3 times.

One important thing to remember is that your workflow implementation must be idempotent. You can read more about that in our documentation.

The implementation looks like this:

/* workflows/MyFirstWorkflow.js */
module.exports.handle = function*(name) {
  yield this.run.task("hello_world_task", name);
  yield this.run.task("hello_world_task", "Me");
  yield this.run.task("hello_world_task", "All");
};

Now that your workflow is implemented, you can ask for its processing like this:

/* launchMyFirstWorkflow.js */
const { run } = require("./client.js");

run.workflow("my_first_workflow", "Gilles");

There are many more features usable in workflows to get the orchestration done right. You can learn more in our documentation.

Getting help

Need help? Feel free to contact us by chat on Zenaton.

Found a bug? You can open a GitHub issue.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].