Skip to content

Commit

Permalink
docs: remove limitation on arrow functions in workflows (#7958)
Browse files Browse the repository at this point in the history
  • Loading branch information
shahednasser authored Jul 4, 2024
1 parent 92dd855 commit 19c20ac
Showing 1 changed file with 0 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 can’t 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` can’t be an async function:
Expand Down

0 comments on commit 19c20ac

Please sign in to comment.