A Node.js library for accessing Amazon SWF
Want to see pretty graphs? Log in now!
npm install aws-swf
|1||downloads in the last day|
|23||downloads in the last week|
|178||downloads in the last month|
|Last Published By|
|Version||4.0.0 last updated 2 months ago|
|Keywords||amazon, aws, swf, workflow|
|Starred by||fgribreau, neyric|
A Node.js library for accessing Amazon Simple Workflow (SWF)
aws-swf provides high-level classes to build Amazon Simple Workflows using Node.js.
- node.js >= 0.8
- An active AWS account with Access Keys
- Basic understanding of AWS SimpleWorkflow concepts
npm install aws-swf
Setting AWS Credentials
Step 1 : Register Domains, ActivityTypes, WorkflowTypes
The AWS SDK is sufficient to register SWF objects, since those are just direct API calls. (You can also register them through the AWS console.)
You can run the following example to register the objects used in the following examples :
Step 2 : Create Activity Workers
This example starts an Activity Worker which completes immediatly.
Step 3 : Create Workflow Deciders
- an EventList instance, to query the state of the workflow
- a DecisionResponse instance, to prepare the decider response with decisions
Simple decider worker example : decision worker, which schedules an activity task, then stop the workflow.
Step 4 : Start a workflow
- Starting a workflow : start an instance of the simple workflow example.
The API documentation is available online at http://neyric.github.io/aws-swf/apidoc/
To rebuild the documentation, install jsdoc, then :
jsdoc lib/*.js README.md -d apidoc
Tests can be executed with Mocha :
To get the coverage, run :
$ ./node_modules/.bin/istanbul cover ./node_modules/mocha/bin/_mocha
Then open coverage/lcov-report/index.html
To send the coverage to coveralls, I run locally (I don't know why travis-ci after-script doesn't work...):
$ NODE_ENV=test ./node_modules/.bin/istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | COVERALLS_REPO_TOKEN=xxxx ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage