chore(docs): Generated References (#8383)

Generated the following references:
- `helper_steps`
- `modules`
- `types`
- `workflows`
This commit is contained in:
github-actions[bot]
2024-08-01 07:04:13 +00:00
committed by GitHub
parent da3da51000
commit 66cc7cfc1f
52 changed files with 23043 additions and 16549 deletions
@@ -0,0 +1,23 @@
import { TypeList } from "docs-ui"
# WorkflowResponse
Workflow response class encapsulates the return value of a workflow
## Type parameters
<TypeList types={[{"name":"TResult","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"THooks","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="WorkflowResponse"/>
## constructor
### Type Parameters
<TypeList types={[{"name":"TResult","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"THooks","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="new WorkflowResponse"/>
### Parameters
<TypeList types={[{"name":"$result","type":"[WorkflowData](../../types/workflows.WorkflowData/page.mdx)&#60;TResult&#62; \\| &#123; [K in string \\| number \\| symbol]: TResult[K] \\| WorkflowDataProperties&#60;TResult[K]&#62; \\| WorkflowData&#60;TResult[K]&#62; &#125;","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"hooks","type":"THooks","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="new WorkflowResponse"/>
___
<TypeList types={[{"name":"__type","type":"`string`","description":"","optional":false,"defaultValue":"OrchestrationUtils.SymbolMedusaWorkflowResponse","expandable":false,"children":[]},{"name":"$result","type":"[WorkflowData](../../types/workflows.WorkflowData/page.mdx)&#60;TResult&#62; \\| &#123; [K in string \\| number \\| symbol]: TResult[K] \\| WorkflowDataProperties&#60;TResult[K]&#62; \\| WorkflowData&#60;TResult[K]&#62; &#125;","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"hooks","type":"THooks","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="WorkflowResponse"/>
@@ -0,0 +1,28 @@
---
slug: /references/workflows/createHook
sidebar_label: createHook
---
import { TypeList } from "docs-ui"
# createHook - Workflows API Reference
This documentation provides a reference to the `createHook` . It belongs to the `@medusajs/workflows-sdk` package.
Define a workflow hook to be executed within steps. The created hook
is exposed publicly for the workflow consumers to inject and run
custom logic.
Hooks behaves like steps
## Type Parameters
<TypeList types={[{"name":"Name","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"TInvokeInput","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="createHook"/>
## Parameters
<TypeList types={[{"name":"name","type":"Name","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"input","type":"TInvokeInput","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="createHook"/>
## Returns
<TypeList types={[{"name":"Hook","type":"[Hook](../../types/workflows.Hook/page.mdx)&#60;Name, TInvokeInput&#62;","optional":false,"defaultValue":"","description":"Define a workflow hook to be executed within steps. The created hook\nis exposed publicly for the workflow consumers to inject and run\ncustom logic.\n\nHooks behaves like steps","expandable":false,"children":[]}]} sectionTitle="createHook"/>
@@ -59,7 +59,7 @@ export const createProductStep = createStep(
## Parameters
<TypeList types={[{"name":"nameOrConfig","type":"`string` \\| `object` & Omit&#60;TransactionStepsDefinition, \"next\" \\| \"uuid\" \\| \"action\"&#62;","description":"The name of the step or its configuration.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"invokeFn","type":"InvokeFn&#60;TInvokeInput, TInvokeResultOutput, TInvokeResultCompensateInput&#62;","description":"An invocation function that will be executed when the workflow is executed. The function must return an instance of [StepResponse](../../classes/workflows.StepResponse/page.mdx). The constructor of [StepResponse](../../classes/workflows.StepResponse/page.mdx)\naccepts the output of the step as a first argument, and optionally as a second argument the data to be passed to the compensation function as a parameter.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"compensateFn","type":"CompensateFn&#60;TInvokeResultCompensateInput&#62;","description":"A compensation function that's executed if an error occurs in the workflow. It's used to roll-back actions when errors occur.\nIt accepts as a parameter the second argument passed to the constructor of the [StepResponse](../../classes/workflows.StepResponse/page.mdx) instance returned by the invocation function. If the\ninvocation function doesn't pass the second argument to `StepResponse` constructor, the compensation function receives the first argument\npassed to the `StepResponse` constructor instead.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="createStep"/>
<TypeList types={[{"name":"nameOrConfig","type":"`string` \\| `object` & Omit&#60;TransactionStepsDefinition, \"next\" \\| \"uuid\" \\| \"action\"&#62;","description":"The name of the step or its configuration.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"invokeFn","type":"[InvokeFn](../../types/workflows.InvokeFn/page.mdx)&#60;TInvokeInput, TInvokeResultOutput, TInvokeResultCompensateInput&#62;","description":"An invocation function that will be executed when the workflow is executed. The function must return an instance of [StepResponse](../../classes/workflows.StepResponse/page.mdx). The constructor of [StepResponse](../../classes/workflows.StepResponse/page.mdx)\naccepts the output of the step as a first argument, and optionally as a second argument the data to be passed to the compensation function as a parameter.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"compensateFn","type":"[CompensateFn](../../types/workflows.CompensateFn/page.mdx)&#60;TInvokeResultCompensateInput&#62;","description":"A compensation function that's executed if an error occurs in the workflow. It's used to roll-back actions when errors occur.\nIt accepts as a parameter the second argument passed to the constructor of the [StepResponse](../../classes/workflows.StepResponse/page.mdx) instance returned by the invocation function. If the\ninvocation function doesn't pass the second argument to `StepResponse` constructor, the compensation function receives the first argument\npassed to the `StepResponse` constructor instead.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="createStep"/>
## Returns
@@ -61,11 +61,11 @@ export async function GET(
## Type Parameters
<TypeList types={[{"name":"TData","type":"`object`","description":"The type of the input passed to the composer function.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"TResult","type":"`object`","description":"The type of the output returned by the composer function.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"THooks","type":"`Record<string, Function>`","description":"The type of hooks defined in the workflow.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="createWorkflow"/>
<TypeList types={[{"name":"TData","type":"`object`","description":"The type of the input passed to the composer function.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"TResult","type":"`object`","description":"The type of the output returned by the composer function.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"THooks","type":"`any`[]","description":"The type of hooks defined in the workflow.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="createWorkflow"/>
## Parameters
<TypeList types={[{"name":"nameOrConfig","type":"`string` \\| `object` & `TransactionModelOptions`","description":"The name of the workflow or its configuration.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"composer","type":"(`input`: [WorkflowData](../../types/workflows.WorkflowData/page.mdx)&#60;TData&#62;) => `void` \\| [WorkflowData](../../types/workflows.WorkflowData/page.mdx)&#60;TResult&#62; \\| &#123; [K in string \\| number \\| symbol]: TResult[K] \\| WorkflowDataProperties&#60;TResult[K]&#62; \\| WorkflowData&#60;TResult[K]&#62; &#125;","description":"The constructor function that is executed when the `run` method in [ReturnWorkflow](../../types/workflows.ReturnWorkflow/page.mdx) is used.\nThe function can't be an arrow function or an asynchronus function. It also can't directly manipulate data.\nYou'll have to use the [transform](../workflows.transform/page.mdx) function if you need to directly manipulate data.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="createWorkflow"/>
<TypeList types={[{"name":"nameOrConfig","type":"`string` \\| `object` & `TransactionModelOptions`","description":"The name of the workflow or its configuration.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"composer","type":"(`input`: [WorkflowData](../../types/workflows.WorkflowData/page.mdx)&#60;TData&#62;) => `void` \\| [WorkflowResponse](../../classes/workflows.WorkflowResponse/page.mdx)&#60;TResult, THooks&#62;","description":"The constructor function that is executed when the `run` method in [ReturnWorkflow](../../types/workflows.ReturnWorkflow/page.mdx) is used.\nThe function can't be an arrow function or an asynchronus function. It also can't directly manipulate data.\nYou'll have to use the [transform](../workflows.transform/page.mdx) function if you need to directly manipulate data.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="createWorkflow"/>
## Returns
@@ -0,0 +1,9 @@
import { TypeList } from "docs-ui"
# ApplyStepOptions
## Type parameters
<TypeList types={[{"name":"TStepInputs","type":"&#123; [K in keyof TInvokeInput]: WorkflowData&#60;TInvokeInput[K]&#62; &#125;","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"TInvokeInput","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"TInvokeResultOutput","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"TInvokeResultCompensateInput","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="ApplyStepOptions"/>
<TypeList types={[{"name":"stepName","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"invokeFn","type":"[InvokeFn](../../types/workflows.InvokeFn/page.mdx)&#60;TInvokeInput, TInvokeResultOutput, TInvokeResultCompensateInput&#62;","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"stepConfig","type":"`TransactionStepsDefinition`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"input","type":"TStepInputs","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"compensateFn","type":"[CompensateFn](../../types/workflows.CompensateFn/page.mdx)&#60;TInvokeResultCompensateInput&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="ApplyStepOptions"/>
@@ -0,0 +1,21 @@
import { TypeList } from "docs-ui"
# CompensateFn
**CompensateFn**: (`input`: T \| `undefined`, `context`: [StepExecutionContext](../../interfaces/workflows.StepExecutionContext/page.mdx)) => `unknown` \| Promise&#60;unknown&#62;
The type of compensation function passed to a step.
## Type Parameters
<TypeList types={[{"name":"T","type":"`object`","description":"The type of the argument passed to the compensation function. If not specified, then it will be the same type as the invocation function's output.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="CompensateFn"/>
## Type declaration
### Parameters
<TypeList types={[{"name":"input","type":"T \\| `undefined`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"context","type":"[StepExecutionContext](../../interfaces/workflows.StepExecutionContext/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"workflowId","type":"`string`","description":"The ID of the workflow.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"attempt","type":"`number`","description":"The attempt number of the step.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"The idempoency key of the step.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"stepName","type":"`string`","description":"The name of the step.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"action","type":"`\"invoke\"` \\| `\"compensate\"`","description":"The action of the step.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"container","type":"[MedusaContainer](../../../medusa/types/medusa.MedusaContainer/page.mdx)","description":"The container used to access resources, such as services, in the step.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`TransactionMetadata`","description":"Metadata passed in the input.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"context","type":"[Context](../../../types/interfaces/types.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="__type"/>
### Returns
<TypeList types={[{"name":"unknown \\| Promise&#60;unknown&#62;","type":"`unknown` \\| Promise&#60;unknown&#62;","optional":false,"defaultValue":"","description":"There's no expected type to be returned by the compensation function.","expandable":false,"children":[]}]} sectionTitle="__type"/>
@@ -6,4 +6,4 @@ import { TypeList } from "docs-ui"
## Properties
<TypeList types={[{"name":"hooks_","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hooksCallback_","type":"`Record<string, Function[]>`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"workflowId","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"flow","type":"`OrchestratorBuilder`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handlers","type":"`WorkflowHandler`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"stepBinder","type":"`<TOutput>`(`fn`: [StepFunctionResult](../workflows.StepFunctionResult/page.mdx)) => [WorkflowData](../workflows.WorkflowData/page.mdx)&#60;TOutput&#62;","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hookBinder","type":"`<TOutput>`(`name`: `string`, `fn`: `Function`) => [WorkflowData](../workflows.WorkflowData/page.mdx)&#60;TOutput&#62;","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"parallelizeBinder","type":"`<TOutput>`(`fn`: (`this`: [CreateWorkflowComposerContext](page.mdx)) => TOutput) => TOutput","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="CreateWorkflowComposerContext"/>
<TypeList types={[{"name":"__type","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hooks_","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"declared","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"registered","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"hooksCallback_","type":"`Record<string, [HookHandler](../workflows.HookHandler/page.mdx)>`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"workflowId","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"flow","type":"`OrchestratorBuilder`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handlers","type":"`WorkflowHandler`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"stepBinder","type":"`<TOutput>`(`fn`: [StepFunctionResult](../workflows.StepFunctionResult/page.mdx)) => [WorkflowData](../workflows.WorkflowData/page.mdx)&#60;TOutput&#62;","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hookBinder","type":"(`name`: `string`, `fn`: () => [HookHandler](../workflows.HookHandler/page.mdx)) => `void`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"parallelizeBinder","type":"`<TOutput>`(`fn`: (`this`: [CreateWorkflowComposerContext](page.mdx)) => TOutput) => TOutput","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="CreateWorkflowComposerContext"/>
@@ -0,0 +1,15 @@
import { TypeList } from "docs-ui"
# Hook
**Hook**: `Object`
Representation of a hook definition.
## Type Parameters
<TypeList types={[{"name":"Name","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"Input","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="Hook"/>
## Properties
<TypeList types={[{"name":"__type","type":"typeof `OrchestrationUtils.SymbolWorkflowHook`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"Name","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":" input","type":"Input","description":"By prefixing a key with a space, we remove it from the\nintellisense of TypeScript. This is needed because\ninput is not set at runtime. It is a type-only\nproperty to infer input data type of a hook","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="Hook"/>
@@ -0,0 +1,15 @@
import { TypeList } from "docs-ui"
# HookHandler
**HookHandler**: (...`args`: `any`[]) => `void` \| Promise&#60;void&#62;
## Type declaration
### Parameters
<TypeList types={[{"name":"args","type":"`any`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="__type"/>
### Returns
<TypeList types={[{"name":"void \\| Promise&#60;void&#62;","type":"`void` \\| Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} sectionTitle="__type"/>
@@ -0,0 +1,21 @@
import { TypeList } from "docs-ui"
# InvokeFn
**InvokeFn**: (`input`: TInput, `context`: [StepExecutionContext](../../interfaces/workflows.StepExecutionContext/page.mdx)) => `void` \| [StepResponse](../../classes/workflows.StepResponse/page.mdx)&#60;TOutput, TCompensateInput extends undefined ? TOutput : TCompensateInput&#62; \| Promise&#60;void \| [StepResponse](../../classes/workflows.StepResponse/page.mdx)&#60;TOutput, TCompensateInput extends undefined ? TOutput : TCompensateInput&#62;&#62;
The type of invocation function passed to a step.
## Type Parameters
<TypeList types={[{"name":"TInput","type":"`object`","description":"The type of the input that the function expects.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"TOutput","type":"`object`","description":"The type of the output that the function returns.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"TCompensateInput","type":"`object`","description":"The type of the input that the compensation function expects.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="InvokeFn"/>
## Type declaration
### Parameters
<TypeList types={[{"name":"input","type":"TInput","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"context","type":"[StepExecutionContext](../../interfaces/workflows.StepExecutionContext/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"workflowId","type":"`string`","description":"The ID of the workflow.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"attempt","type":"`number`","description":"The attempt number of the step.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"The idempoency key of the step.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"stepName","type":"`string`","description":"The name of the step.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"action","type":"`\"invoke\"` \\| `\"compensate\"`","description":"The action of the step.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"container","type":"[MedusaContainer](../../../medusa/types/medusa.MedusaContainer/page.mdx)","description":"The container used to access resources, such as services, in the step.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`TransactionMetadata`","description":"Metadata passed in the input.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"context","type":"[Context](../../../types/interfaces/types.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="__type"/>
### Returns
<TypeList types={[{"name":"void \\| StepResponse&#60;TOutput, TCompensateInput extends undefined ? TOutput : TCompensateInput&#62; \\| Promise&#60;void \\| StepResponse&#60;TOutput, TCompensateInput extends undefined ? TOutput : TCompensateInput&#62;&#62;","type":"`void` \\| [StepResponse](../../classes/workflows.StepResponse/page.mdx)&#60;TOutput, TCompensateInput extends undefined ? TOutput : TCompensateInput&#62; \\| Promise&#60;void \\| [StepResponse](../../classes/workflows.StepResponse/page.mdx)&#60;TOutput, TCompensateInput extends undefined ? TOutput : TCompensateInput&#62;&#62;","optional":false,"defaultValue":"","description":"The expected output based on the type parameter `TOutput`.","expandable":false,"children":[]}]} sectionTitle="__type"/>
@@ -2,7 +2,7 @@ import { TypeList } from "docs-ui"
# ReturnWorkflow
**ReturnWorkflow**: `<TDataOverride, TResultOverride>`(`container?`: [MedusaContainer](../../../medusa/types/medusa.MedusaContainer/page.mdx) \| ``{ __joinerConfig: [ModuleJoinerConfig](../../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleJoinerConfig/page.mdx) ; __definition: [ModuleDefinition](../../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleDefinition/page.mdx) }``[]) => Omit&#60;LocalWorkflow, "run" \| "registerStepSuccess" \| "registerStepFailure" \| "cancel"&#62; & ExportedWorkflow&#60;TData, TResult, TDataOverride, TResultOverride&#62; & THooks & `object`
**ReturnWorkflow**: `<TDataOverride, TResultOverride>`(`container?`: [MedusaContainer](../../../medusa/types/medusa.MedusaContainer/page.mdx) \| ``{ __joinerConfig: [ModuleJoinerConfig](../../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleJoinerConfig/page.mdx) ; __definition: [ModuleDefinition](../../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleDefinition/page.mdx) }``[]) => Omit&#60;LocalWorkflow, "run" \| "registerStepSuccess" \| "registerStepFailure" \| "cancel"&#62; & ExportedWorkflow&#60;TData, TResult, TDataOverride, TResultOverride&#62; & `object`
An exported workflow, which is the type of a workflow constructed by the [createWorkflow](../../functions/workflows.createWorkflow/page.mdx) function. The exported workflow can be invoked to create
an executable workflow, optionally within a specified container. So, to execute the workflow, you must invoke the exported workflow, then run the
@@ -53,4 +53,4 @@ export async function GET(
## Type Parameters
<TypeList types={[{"name":"TData","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"TResult","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"THooks","type":"`Record<string, Function>`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="ReturnWorkflow"/>
<TypeList types={[{"name":"TData","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"TResult","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"THooks","type":"`any`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="ReturnWorkflow"/>
@@ -12,7 +12,7 @@ import { TypeList } from "docs-ui"
### Parameters
<TypeList types={[{"name":"this","type":"[CreateWorkflowComposerContext](../workflows.CreateWorkflowComposerContext/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"hooks_","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hooksCallback_","type":"`Record<string, Function[]>`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"workflowId","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"flow","type":"`OrchestratorBuilder`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handlers","type":"`WorkflowHandler`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"stepBinder","type":"`<TOutput>`(`fn`: [StepFunctionResult](page.mdx)) => [WorkflowData](../workflows.WorkflowData/page.mdx)&#60;TOutput&#62;","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hookBinder","type":"`<TOutput>`(`name`: `string`, `fn`: `Function`) => [WorkflowData](../workflows.WorkflowData/page.mdx)&#60;TOutput&#62;","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"parallelizeBinder","type":"`<TOutput>`(`fn`: (`this`: [CreateWorkflowComposerContext](../workflows.CreateWorkflowComposerContext/page.mdx)) => TOutput) => TOutput","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="__type"/>
<TypeList types={[{"name":"this","type":"[CreateWorkflowComposerContext](../workflows.CreateWorkflowComposerContext/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"hooks_","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hooksCallback_","type":"`Record<string, [HookHandler](../workflows.HookHandler/page.mdx)>`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"workflowId","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"flow","type":"`OrchestratorBuilder`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handlers","type":"`WorkflowHandler`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"stepBinder","type":"`<TOutput>`(`fn`: [StepFunctionResult](page.mdx)) => [WorkflowData](../workflows.WorkflowData/page.mdx)&#60;TOutput&#62;","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hookBinder","type":"(`name`: `string`, `fn`: () => [HookHandler](../workflows.HookHandler/page.mdx)) => `void`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"parallelizeBinder","type":"`<TOutput>`(`fn`: (`this`: [CreateWorkflowComposerContext](../workflows.CreateWorkflowComposerContext/page.mdx)) => TOutput) => TOutput","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="__type"/>
### Returns
@@ -14,4 +14,4 @@ type WorkflowInputData = UnwrapWorkflowInputDataType<typeof myWorkflow>
## Type Parameters
<TypeList types={[{"name":"T","type":"[ReturnWorkflow](../workflows.ReturnWorkflow/page.mdx)&#60;any, any, any&#62;","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"runAsStep","type":"(`{\n input,\n }`: ``{ input: TData \\| [WorkflowData](../workflows.WorkflowData/page.mdx)&#60;TData&#62; }``) => ReturnType&#60;[StepFunction](../workflows.StepFunction/page.mdx)&#60;TData, TResult&#62;&#62;","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"run","type":"`<TDataOverride, TResultOverride>`(...`args`: Parameters&#60;ExportedWorkflow&#60;TData, TResult, TDataOverride, TResultOverride&#62;[\"run\"]&#62;) => ReturnType&#60;ExportedWorkflow&#60;TData, TResult, TDataOverride, TResultOverride&#62;[\"run\"]&#62;","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"getName","type":"() => `string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"(`config`: `TransactionModelOptions`) => `void`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="UnwrapWorkflowInputDataType"/>
<TypeList types={[{"name":"T","type":"[ReturnWorkflow](../workflows.ReturnWorkflow/page.mdx)&#60;any, any, any&#62;","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"runAsStep","type":"(`{\n input,\n }`: ``{ input: TData \\| [WorkflowData](../workflows.WorkflowData/page.mdx)&#60;TData&#62; }``) => ReturnType&#60;[StepFunction](../workflows.StepFunction/page.mdx)&#60;TData, TResult&#62;&#62;","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"run","type":"`<TDataOverride, TResultOverride>`(...`args`: Parameters&#60;ExportedWorkflow&#60;TData, TResult, TDataOverride, TResultOverride&#62;[\"run\"]&#62;) => ReturnType&#60;ExportedWorkflow&#60;TData, TResult, TDataOverride, TResultOverride&#62;[\"run\"]&#62;","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"getName","type":"() => `string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"(`config`: `TransactionModelOptions`) => `void`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hooks","type":"ConvertHooksToFunctions&#60;THooks&#62;","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="UnwrapWorkflowInputDataType"/>