Last active
August 29, 2015 14:10
-
-
Save debianmaster/8926265e0d3df0a2bd6a to your computer and use it in GitHub Desktop.
workflows.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
example: | |
{ | |
name: 'example workflow', | |
chain: [ | |
{ | |
name: 'Print foo + bar', | |
timeout: 1, | |
retry: 1, | |
body: function (job, cb) { | |
job.result = {message:(job.foo +"-----"+ job.bar)}; | |
cb(null,"task 1 done"); | |
}, | |
fallback: function (err, job, cb) { | |
job.result="Error in task 1"; | |
cb("Error"); | |
} | |
}, | |
{ | |
name: 'Add some other info', | |
timeout: 1, | |
retry: 1, | |
body: function (job, cb) { | |
job.result.status=200; | |
cb(null,"task 2 done"); | |
}, | |
fallback: function (err, job, cb) { | |
cb("Error in task 2"); | |
} | |
} | |
], | |
timeout: 3, | |
onerror: [ | |
{ | |
name: 'Rollback', | |
body: function (job, cb) { | |
cb("Error"); | |
} | |
} | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment