The Reusable, Scalable, and Quick node.js API Server!

What is actionhero?

actionhero.js is a multi-transport Node.JS API Server with integrated cluster capabilities and delayed tasks.

What does that mean?

In actionhero, you make actions which respond to client requests.

// actionhero generateAction --name=randomNumber
// File: actions/randomNumber.js

exports.randomNumber = {
  name: 'randomNumber',
  description: 'I am an API method which will generate a random number',
  outputExample: {
    randomNumber: 0.123

  run: function(api, data, next){
    data.response.randomNumber = Math.random();


These actions don't just work for the web, they work for all sorts of clients.


> curl localhost:8080/api/randomNumber

  "randomNumber": 0.8158452461939305


> telnet localhost 5000
Connected to localhost.
Escape character is '^]'.
{"welcome":"Hello! Welcome to the actionhero api","context":"api"}


var client = new ActionheroClient;
client.connect(function(error, details){
    client.action("randomNumber", function(data){

actionhero also lets you perform tasks in the background...

// actionhero generateTask --name=sendEmail
// File: tasks/sendEmail.js
exports.task = {
    name:        'sendEmail',
    description: 'send an email to users after they sign up'
    queue:       'default',
    frequency:    0,
    run: function(api, params, next){
        // email sending stub
        api.users.sendEmail(params.userId, function(error, done){

... and you can invoke the task from anywhere in the framework, including actions.

// api.tasks.enqueue(nameOfTask, args, queue, callback)
api.tasks.enqueue("sendEmail", {to: ''}, 'default', function(error, toRun){
  // enqueued!

actionhero enables clients to talk to each other.

// client 1
var client1 = new ActionheroClient;
client1.connect(function(error, details){
    client1.roomAdd("myChatRoom", function(error){
        client1.say('myChatRoom', 'hello from client 1');

// client 2
var client2 = new ActionheroClient;
client2.connect(function(error, details){
    client2.roomAdd("myChatRoom", function(error){
        client2.on('say', function(message){

actionhero can do all of this, and it can work on one server or hundreds (actionhero is cluster-ready from the get-go).

# start 1 instance
./node_modules/.bin/actionhero start
# start a cluster
./node_modules/.bin/actionhero startCluster

Click here to learn more

or jump in to the documention

or read Actionhero articles


Try actionhero Now

npm install actionhero

./node_modules/.bin/actionhero generate

npm install

npm start

Get Actionhero Stuff