feat(workflows-sdk): Allow a step to not define an expected input (#5775)

**What**
Allow a step to not define an expected input, previously even if no input was expected, an object was always expected to be passed to the stepFunction inside the workflow composition. Now
```ts
const stepWithoutArgs = createStep("step1", () => {
  return new StepResponse("string")
})

const stepWithoutExepectedInput = createStep("step2", (_: {}, context) => {
  console.log("input", _) // {}
  return new StepResponse("string")
})

const workflow = createWorkflow("workflow1", () => {
  stepWithoutArgs()
  return stepWithoutExepectedInput()
})

workflow()
  .run()
  .then((res) => {
    console.log(res.result) // string
  })
```
This commit is contained in:
Adrien de Peretti
2023-12-21 13:41:58 +00:00
committed by GitHub
parent 890e76a5c5
commit 8402f46970
5 changed files with 73 additions and 21 deletions
+2 -1
View File
@@ -39,6 +39,7 @@
"prepublishOnly": "cross-env NODE_ENV=production tsc --build",
"build": "rimraf dist && tsc --build",
"watch": "tsc --build --watch",
"test": "jest --runInBand --bail --forceExit"
"test": "jest --runInBand --bail --forceExit",
"test:run": "../../node_modules/.bin/ts-node ./src/utils/_test.ts"
}
}