Step Function

Here are the function signatures you can use to implement a step function:

  • with callbacks:
function (context, input, cb) {
  ...
  cb(err, output)
}
  • with promises:
function (context, input) {
  return new Promise ((resolve, reject) => {
    ...
    resolve(output) || reject(err)
  })
}
  • with async/await:
async function (context, input) {
  ...
  return output || throw err
}

Context

The context contains of the following properties: