docs: general updates after 2.5.0 update (#11402)

This commit is contained in:
Shahed Nasser authored and GitHub committed 2025-02-11 18:26:21 +02:00
1 parent ca486aa7ed
commit 5cb44d364d
17 files changed
+11576 -11565

No files matched your search

@@ -50,7 +50,7 @@ import { createStep, createWorkflow } from "@medusajs/framework/workflows-sdk"
const step1 = createStep(
{
name: "step-1"
name: "step-1",
},
async () => {
console.log("Hello from step 1")
@@ -61,7 +61,7 @@ export const helloWorkflow = createWorkflow(
{
name: "hello-workflow",
retentionTime: 99999,
store: true
store: true,
},
() => {
step1()
@@ -98,8 +98,8 @@ export const retrieveHighlights = [
]
```ts title="src/workflows/[id]/route.ts" highlights={retrieveHighlights}
import { MedusaRequest, MedusaResponse } from "@medusajs/framework";
import { Modules } from "@medusajs/framework/utils";
import { MedusaRequest, MedusaResponse } from "@medusajs/framework"
import { Modules } from "@medusajs/framework/utils"
export async function GET(
req: MedusaRequest,
@@ -112,11 +112,11 @@ export async function GET(
)
const [workflowExecution] = await workflowEngineService.listWorkflowExecutions({
transaction_id: transaction_id
transaction_id: transaction_id,
})
res.json({
workflowExecution
workflowExecution,
})
}
```
@@ -165,7 +165,7 @@ To check if a stored workflow execution failed, you can check its `state` proper
```ts
if (workflowExecution.state === "failed") {
return res.status(500).json({
error: "Workflow failed"
error: "Workflow failed",
})
}
```