Using Codehooks.io, creating realiable and durable workflows has never been easier, nothing to learn, just plain JavaScript.
import { app } from 'codehooks-js'
// The workflow definition
const workflow = app.createWorkflow('minimal', 'Minimal workflow example', {
start: (state, goto) => { goto('end', {...state, message: 'Hello World'}) },
end: (state, goto) => goto(null, state) // null complete the workflow
})
// A REST API to start a new workflow instance
app.post('/start', async (req, res) => res.json(await workflow.start({prop: 'some value'})))
export default app.init()
Top comments (0)