Setting Up A Zenaton Project


If this is your first project, you probably want to follow the Hello World step-by-step example.

In your new project directory, you will need to

  • have node.js (version >= 8.0) installed
  • install the Zenaton node library
  • add a boot.js file describing where to find tasks and workflow definitions
  • install and set up a Zenaton Agent

# Install Zenaton lib

Add a package.json file with following dependencies:

  "dependencies": {
    "zenaton": "^0.7.3"

Then install dependencies:

npm install

# Add a Boot File

Tasks and workflows will be processed in the background by a Zenaton Agent (see below). You need to provide the agent with a boot.js file that describes tasks and workflow definitions:

Eg. if you have a unique MyTask task and MyWorkflow workflow, your ./boot.js will be:

// load zenaton library
const { task, workflow } = require('zenaton');

// define "MyWorkflow" workflow
workflow("MyWorkflow", require("./src/myWorkflow"));

// define "MyTask" task
task("MyTask", require("./src/MyTask"));


Do not forget to update this file, when adding task or workflow.


You can also regroup all task and workflow definition into some Tasks and Workflows directories, and name a workflow (or task) directly where you describe it. Then your boot.js file can be written to load all files in those directories. This way you do not have to update it when creating a new task or workflow.

Look at documentation to see how to define workflows and tasks.

# Install Zenaton Agent

When developing locally, a Zenaton Agent needs to be installed on your computer.

This Agent will listen to the queues automaticaly deployed when we dispatch a task or a workflow. This Agent will both process tasks and decisions (a decision is the action to process your workflow file to decide what to do next).

To install the Zenaton Agent on your computer, type:

curl | sh


Zenaton Agent is currently only available on mac and linux.

The Agent itself will be installed in ~/.zenaton
The CLI will be installed (usually) in /usr/local/bin

Once installed, you need to configure it to listen to your application:

zenaton listen \
  --app_id=<app_id> \
  --api_token=<api_token> \

Your <app_id> and <api_token> are given in your API section


Define an .env file to avoid having to type you creadential each time: