docs: documentation updates for v2.10.2 (#13500)

This commit is contained in:
Shahed Nasser authored and GitHub committed 2025-09-15 13:56:50 +03:00
1 parent ebf33bea43
commit 5589b7351a
9 files changed
+608 -63

No files matched your search

@@ -44,6 +44,106 @@ You can then use the Workflow Engine Module's service's methods in the step. The
---
## retryStep
This method retries a step that has temporary failed, such as a step that has `autoRetry` set to `false` or when the machine running the Medusa application shuts down. Learn more about it in the [Retry Failed Steps](!docs!/learn/fundamentals/workflows/retry-failed-steps) guide.
<Note>
This method is available since [Medusa v2.10.2](https://github.com/medusajs/medusa/releases/tag/v2.10.2).
</Note>
### Example
```ts
// other imports...
import {
TransactionHandlerType,
} from "@medusajs/framework/utils"
workflowEngine.retryStep({
idempotencyKey: {
action: TransactionHandlerType.INVOKE,
transactionId,
stepId: "step-1",
workflowId: "hello-world",
},
})
```
### Parameters
<TypeList types={[
{
"name": "idempotencyKey",
"type": "`object`",
"description": "The details of the step to retry.",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": [
{
"name": "action",
"type": "`invoke` | `compensate`",
"description": "If the step's compensation function is running, use `compensate`. Otherwise, use `invoke`.",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
},
{
"name": "transactionId",
"type": "`string`",
"description": "The ID of the workflow execution's transaction.",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
},
{
"name": "stepId",
"type": "`string`",
"description": "The ID of the step to change its status. This is the first parameter passed to `createStep` when creating the step.",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
},
{
"name": "workflowId",
"type": "`string`",
"description": "The ID of the workflow. This is the first parameter passed to `createWorkflow` when creating the workflow.",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
}
]
},
{
"name": "options",
"type": "`object`",
"description": "Options to pass to the step.",
"optional": true,
"defaultValue": "",
"expandable": false,
"children": [
{
"name": "container",
"type": "`Container`",
"description": "An instance of the Medusa container.",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
}
]
}
]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="retryStep"/>
---
## setStepSuccess
This method sets an async step in a currently-executing [long-running workflow](!docs!/learn/fundamentals/workflows/long-running-workflow) as successful. The workflow will then continue to the next step.
@@ -64,9 +164,6 @@ await workflowEngineModuleService.setStepSuccess({
workflowId: "hello-world",
},
stepResponse: new StepResponse("Done!"),
options: {
container,
},
})
```
@@ -132,7 +229,7 @@ await workflowEngineModuleService.setStepSuccess({
"name": "options",
"type": "`object`",
"description": "Options to pass to the step.",
"optional": false,
"optional": true,
"defaultValue": "",
"expandable": false,
"children": [
@@ -171,9 +268,6 @@ await workflowEngineModuleService.setStepFailure({
workflowId: "hello-world",
},
stepResponse: new StepResponse("Failed!"),
options: {
container,
},
})
```
@@ -239,7 +333,7 @@ await workflowEngineModuleService.setStepFailure({
"name": "options",
"type": "`object`",
"description": "Options to pass to the step.",
"optional": false,
"optional": true,
"defaultValue": "",
"expandable": false,
"children": [
+3 -1
View File
@@ -6123,7 +6123,7 @@ export const generatedEditDates = {
"references/tax/types/tax.Message/page.mdx": "2025-04-11T09:04:52.576Z",
"references/types/interfaces/types.IFulfillmentProvider/page.mdx": "2025-05-20T07:51:41.084Z",
"references/user/types/user.Message/page.mdx": "2025-04-11T09:04:52.767Z",
"app/infrastructure-modules/workflow-engine/how-to-use/page.mdx": "2025-03-27T14:53:13.311Z",
"app/infrastructure-modules/workflow-engine/how-to-use/page.mdx": "2025-09-15T08:06:10.452Z",
"references/core_flows/Notification/Steps_Notification/functions/core_flows.Notification.Steps_Notification.notifyOnFailureStep/page.mdx": "2025-04-23T16:21:19.025Z",
"app/troubleshooting/api-routes/additional-data-error/page.mdx": "2025-03-27T17:39:10.858Z",
"app/troubleshooting/api-routes/middleware-registration/page.mdx": "2025-04-17T10:35:42.095Z",
@@ -6531,6 +6531,8 @@ export const generatedEditDates = {
"references/core_flows/Draft_Order/Steps_Draft_Order/variables/core_flows.Draft_Order.Steps_Draft_Order.deleteDraftOrdersStepId/page.mdx": "2025-06-05T19:05:37.064Z",
"references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.deleteDraftOrdersWorkflow/page.mdx": "2025-09-15T09:52:13.890Z",
"references/core_flows/Draft_Order/Workflows_Draft_Order/variables/core_flows.Draft_Order.Workflows_Draft_Order.deleteDraftOrderWorkflowId/page.mdx": "2025-06-05T19:05:37.318Z",
"references/core_flows/Locking/functions/core_flows.Locking.acquireLockStep/page.mdx": "2025-09-15T09:11:26.324Z",
"references/core_flows/Locking/functions/core_flows.Locking.releaseLockStep/page.mdx": "2025-09-15T09:11:38.276Z",
"references/core_flows/core_flows.Locking/page.mdx": "2025-09-15T09:52:14.217Z",
"references/core_flows/interfaces/core_flows.AcquireLockStepInput/page.mdx": "2025-09-15T09:52:15.944Z",
"references/core_flows/interfaces/core_flows.ReleaseLockStepInput/page.mdx": "2025-09-15T09:52:15.945Z",