An Amazon State Language based state machine.
It is probably worth pointing out that this design probably isn't terribly practical in reality. There are many ways to solve this problem but the current structure was chosen for ease of development, to better understand the problem space, and to get a feel for the Amazon State Language spec itself. One could imagine many different approaches, including:
See additional notes below.
const json = {
"StartAt": "Demo",
"States": {
"Demo": {
"Type": "Pass",
"Result": {
"pass": {
"a": "b"
}
},
"Next": "Done"
},
"Done": {
"Type": "Succeed"
}
}
};
const input = {
foo: {
bar: true,
},
};
const machine = Machine.create(json);
const result = await machine.run(input);
console.log(result);
$ npm test
.npmrc
) was explicitly chosen for OpenWhisk
compatibility. The associated stability that comes with selecting one runtime
is preferred for now (in the early stages of development) over flexbility
across providers.