docs: added workflow hooks docs + changed workflow response (#8364)

* docs: added workflow hooks docs + changed workflow response

* Update page.mdx
This commit is contained in:
Shahed Nasser
2024-07-31 17:01:33 +03:00
committed by GitHub
parent 27837b8833
commit 6f973d9f2b
29 changed files with 321 additions and 167 deletions
@@ -14,10 +14,11 @@ You can configure the step to retry on failure. The `createStep` function can ac
For example:
```ts title="src/workflows/hello-world.ts" highlights={[["9"]]} collapsibleLines="1-5" expandButtonLabel="Show Imports"
```ts title="src/workflows/hello-world.ts" highlights={[["10"]]} collapsibleLines="1-6" expandButtonLabel="Show Imports"
import {
createStep,
createWorkflow,
WorkflowResponse,
} from "@medusajs/workflows-sdk"
const step1 = createStep(
@@ -37,9 +38,9 @@ const myWorkflow = createWorkflow(
function () {
const str1 = step1()
return {
return new WorkflowResponse({
message: str1,
}
})
})
export default myWorkflow