Skip to content

Commit 1c1e1c6

Browse files
authored
docs: improved workflows integration tests guide (medusajs#13090)
1 parent 11318ea commit 1c1e1c6

File tree

4 files changed

+867
-63
lines changed

4 files changed

+867
-63
lines changed

www/apps/book/app/learn/debugging-and-testing/debug-workflows/page.mdx

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -28,31 +28,31 @@ There are several ways to debug workflows in Medusa:
2828
<Table.Body>
2929
<Table.Row>
3030
<Table.Cell>
31-
Write integration tests
31+
[Write integration tests](#approach-1-write-integration-tests)
3232
</Table.Cell>
3333
<Table.Cell>
3434
To ensure your workflow produces the expected results and handles edge cases.
3535
</Table.Cell>
3636
</Table.Row>
3737
<Table.Row>
3838
<Table.Cell>
39-
Add breakpoints
39+
[Add breakpoints](#approach-2-add-breakpoints)
4040
</Table.Cell>
4141
<Table.Cell>
4242
To inspect specific steps in your workflow and understand the data flow.
4343
</Table.Cell>
4444
</Table.Row>
4545
<Table.Row>
4646
<Table.Cell>
47-
Log messages
47+
[Log messages](#approach-3-log-messages)
4848
</Table.Cell>
4949
<Table.Cell>
5050
To check values during execution with minimal overhead.
5151
</Table.Cell>
5252
</Table.Row>
5353
<Table.Row>
5454
<Table.Cell>
55-
View Workflow Executions in Medusa Admin
55+
[View Workflow Executions in Medusa Admin](#approach-4-monitor-workflow-executions-in-medusa-admin)
5656
</Table.Cell>
5757
<Table.Cell>
5858
To monitor stored workflow executions and long-running workflows, especially in production environments.
@@ -140,12 +140,12 @@ import {
140140
createWorkflow,
141141
StepResponse,
142142
WorkflowResponse,
143-
} from "@medusajs/framework/workflows-sdk";
143+
} from "@medusajs/framework/workflows-sdk"
144144

145145
const step1 = createStep(
146146
"step-1",
147147
async () => {
148-
const message = "Hello from step 1!";
148+
const message = "Hello from step 1!"
149149

150150
return new StepResponse(
151151
message
@@ -171,10 +171,10 @@ export const myWorkflow = createWorkflow(
171171
step2()
172172

173173
return new WorkflowResponse({
174-
response
174+
response,
175175
})
176176
}
177-
);
177+
)
178178
```
179179
</CodeTab>
180180
<CodeTab label="Transform Callback" value="transform-callback">
@@ -424,12 +424,12 @@ import {
424424
createWorkflow,
425425
StepResponse,
426426
WorkflowResponse,
427-
} from "@medusajs/framework/workflows-sdk";
427+
} from "@medusajs/framework/workflows-sdk"
428428

429429
const step1 = createStep(
430430
"step-1",
431431
async () => {
432-
const message = "Hello from step 1!";
432+
const message = "Hello from step 1!"
433433

434434
return new StepResponse(
435435
message
@@ -447,10 +447,10 @@ export const myWorkflow = createWorkflow(
447447
const response = step1()
448448

449449
return new WorkflowResponse({
450-
response
450+
response,
451451
})
452452
}
453-
);
453+
)
454454
```
455455

456456
<Note>
@@ -460,12 +460,3 @@ Refer to the [Store Workflow Executions](../../fundamentals/workflows/store-exec
460460
</Note>
461461

462462
You can view all executions of this workflow in the Medusa Admin under the [Workflows settings page](!user-guide!/settings/developer/workflows). Each execution will show you the status, input, and output data.
463-
464-
---
465-
466-
## Related Topics
467-
468-
- [Error Handling in Workflows](../../fundamentals/workflows/errors/page.mdx) - For debugging error scenarios and compensation functions
469-
- [Long-Running Workflows](../../fundamentals/workflows/long-running-workflow/page.mdx) - For debugging async workflows and step status management
470-
- [Store Workflow Executions](../../fundamentals/workflows/store-executions/page.mdx) - For programmatic access to execution details
471-
- [Workflow Execution States](!user-guide!/settings/developer/workflows#workflow-execution-status) - For understanding execution statuses in the admin

0 commit comments

Comments
 (0)