docs: remove limitation on arrow functions in workflows (#7958)

This commit is contained in:
Shahed Nasser
2024-07-04 20:26:26 +03:00
committed by GitHub
parent 92dd855290
commit 19c20ac747

View File

@@ -6,30 +6,6 @@ export const metadata = {
This chapter lists some constraints to keep in mind when defining a workflow's constructor function.
## No Arrow Functions
The function passed to the `createWorkflow` function cant be an arrow function:
```ts highlights={[["5", "=>", "Function can't be an arrow function"], ["13", "", "Correct way of defining the function."]]}
// Don't
const myWorkflow = createWorkflow<
WorkflowInput,
WorkflowOutput
>("hello-world", (input) => {
// ...
})
// Do
const myWorkflow = createWorkflow<
WorkflowInput,
WorkflowOutput
>("hello-world", function (input) {
// ...
})
```
---
## No Async Functions
The function passed to the `createWorkflow` cant be an async function: