Reshuffle Integration Framework
Reshuffle is a lightweight and open source integration framework. With Reshuffle you can build integrations, connect systems, and build workflows.
Here is a simple workflow that listens to a cron event that runs every 5 sec:
const Reshuffle CronService =const app = ;const cronService = ;app;appappstart
At its core Reshuffle is an event-based engine. Very similar to programming with a web server, you just need to define a function that will be called when an event is triggered.
Events can be anything from a file change, S3 bucket update, a cron job timer, your own custom event, or even an HTTP call.
Here is an example of listening to a HTTP get event on /test, using the HTTP service:
const Reshuffle HttpService =const app = ;const httpService = ;app;appappstart
More examples can be found here [TBD]
Easy services configuration
A critical aspect of building integrations is configuring how to connect to different services we want to integrate with. With Reshuffle you can easily configure Service objects and inject them.
Let's expend the example above and send a message to a Slack, everytime someone triggers the 'HTTP/GET/test' event:
const Reshuffle HttpService SlackService =const app = ;const connectionOptions ='APIToken':processenvSLACK_AUTH_KEY'team':'ourTeam'const httpService = ;appconst slackService = connectionOptions;app;appappstart
Service objects expose the API and Events that the external service (from a DB to an ERP) provides. You can spesify an id when you register a service to the app with the use(service, service_id) and then access that service using the getService(service_id) method.
You noticed in the code sample that we provided important information on how to connect to the 3rd party system (in that case, Slack). Services are an easy way to seperate the connection configuration from your code, configure a connection to a service once and use it anywhere.
You can use the Service object to take action on a remote service (such as adding a row to a CRM) and configure events that trigger when something happens in that system. We will show you how to do that in the next section.
A full list of Services, and how to create your own Service, can be found here [TBD]
As we saw, services are basically adaptors that connect external systems, such as Slack, Database, CRM, or any other system. Services can be configured to emit a Reshuffle event, when a preconfigured thing happens in these systems.
Here is how you would configure a SlackService to listen to a message from Slack:
const Reshuffle SlackService =const app = ;const connectionOptions ='APIToken':processenvSLACK_AUTH_KEY'team':'ourTeam'const slackService = connectionOptions;app;const eventOptions ='event_type':'new_message''channel':'C6646754636''type':'new_message'appappstart
It is the responsibility of the SlackService to listen to the events in Slack and emit corresponding events in Reshuffle. Your code can listen to these events and run business logic.
As you can see, both the event creation and the business logic, use the same Service configuration. This makes configuration easier to manage.
A full list of events, and how to create your own event, can be found here [TBD]
Before installing, download and install Node.js. Node.js 0.10 or higher is required.
If this is a brand new project, make sure to create a
package.json first with
npm init command.
Installation is done using the
npm install command:
$ npm install reshuffle
- Simple Express-style event handling
- Focus on high performance
- Separation of configuration and execution
- Connects out of the box with many SAAS services
- Highly extendable
Install the engine
$ npm install -g reshuffle
helloWorldHTTPExample.js example from the example folder into your /tmp/foo.
$ npm install
$ node helloWorldHTTPExample
got to http://localhost:8000/test
Examples can be found in the /examples folder