- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
Steps_Common
Properties#
- options
- fields
- fields
- fields
- variables
- variables
- variables
- throw_if_key_not_found
- throw_if_key_not_found
- throw_if_key_not_found
- throw_if_relation_not_found
- throw_if_relation_not_found
- throw_if_relation_not_found
- list
- list
- list
- entry_point
- service
Variables#
- createLinksStepId
- dismissRemoteLinkStepId
- emitEventStepId
- removeRemoteLinkStepId
- updateRemoteLinksStepId
- useRemoteQueryStepId
Functions#
- createRemoteLinkStep
- dismissRemoteLinkStep
- emitEventStep
- removeRemoteLinkStep
- updateRemoteLinksStep
- useQueryGraphStep
- useRemoteQueryStep
fields
string[]fields
string[]fields
string[]entry_point
stringservice
stringvariables
Record<string, any>Optionalvariables
Record<string, any>Optionalvariables
Record<string, any>Optionalthrow_if_key_not_found
booleanOptionalthrow_if_key_not_found
booleanOptionalthrow_if_key_not_found
booleanOptionalthrow_if_relation_not_found
boolean | string[]Optionalthrow_if_relation_not_found
boolean | string[]Optionalthrow_if_relation_not_found
boolean | string[]Optionallist
booleanOptionalDefault: true
list
booleanOptionalDefault: true
list
booleanOptionalDefault: true
createLinksStepId#
Const
createLinksStepId: "create-remote-links"
dismissRemoteLinkStepId#
Const
dismissRemoteLinkStepId: "dismiss-remote-links"
emitEventStepId#
Const
emitEventStepId: "emit-event-step"
removeRemoteLinkStepId#
Const
removeRemoteLinkStepId: "remove-remote-links"
updateRemoteLinksStepId#
Const
updateRemoteLinksStepId: "update-remote-links-step"
useRemoteQueryStepId#
Const
useRemoteQueryStepId: "use-remote-query"
createRemoteLinkStep#
This step creates remote links between two records of linked data models.
Learn more in the Remote Link documentation..
Example#
1import { createWorkflow } from "@medusajs/framework/workflows-sdk"2import { createRemoteLinkStep } from "@medusajs/medusa/core-flows"3import { Modules } from "@medusajs/framework/utils"4 5const helloWorldWorkflow = createWorkflow("hello-world", () => {6 createRemoteLinkStep([7 {8 [Modules.PRODUCT]: {9 product_id: "prod_123",10 },11 helloModuleService: {12 my_custom_id: "mc_123",13 },14 },15 ])16})
Input#
LinkDefinition[]
LinkDefinition[]
LinkDefinition[]
LinkDefinition[]Output#
LinkDefinition[]
LinkDefinition[]
LinkDefinition[]
LinkDefinition[]dismissRemoteLinkStep#
This step removes remote links between two records of linked data models.
Learn more in the Remote Link documentation..
Example#
1import {2 createWorkflow3} from "@medusajs/framework/workflows-sdk"4import {5 dismissRemoteLinkStep6} from "@medusajs/medusa/core-flows"7import {8 Modules9} from "@medusajs/framework/utils"10 11const helloWorldWorkflow = createWorkflow(12 "hello-world",13 () => {14 dismissRemoteLinkStep([{15 [Modules.PRODUCT]: {16 product_id: "prod_123",17 },18 "helloModuleService": {19 my_custom_id: "mc_123",20 },21 }])22 }23)
Input#
DismissRemoteLinksStepInput
DismissRemoteLinksStepInput
DismissRemoteLinksStepInput
DismissRemoteLinksStepInputOutput#
LinkDefinition[]
LinkDefinition[]
LinkDefinition[]
LinkDefinition[]emitEventStep#
Emit an event.
Example#
Input#
Input
InputremoveRemoteLinkStep#
This step deletes linked records of a record.
Learn more in the Remote Link documentation
Example#
1import {2 createWorkflow3} from "@medusajs/framework/workflows-sdk"4import {5 removeRemoteLinkStep6} from "@medusajs/medusa/core-flows"7import {8 Modules9} from "@medusajs/framework/utils"10 11const helloWorldWorkflow = createWorkflow(12 "hello-world",13 () => {14 removeRemoteLinkStep([{15 [Modules.PRODUCT]: {16 product_id: "prod_123",17 },18 }])19 }20)
Input#
RemoveRemoteLinksStepInput
RemoveRemoteLinksStepInputOutput#
DeleteEntityInput
DeleteEntityInput
DeleteEntityInput
DeleteEntityInputupdateRemoteLinksStep#
Input#
LinkDefinition[]
LinkDefinition[]
LinkDefinition[]
LinkDefinition[]Output#
LinkDefinition[]
LinkDefinition[]
LinkDefinition[]
LinkDefinition[]useQueryGraphStep#
Type Parameters#
TEntry
stringOptionalParameters#
input
UseQueryGraphStepInput<TEntry>
input
UseQueryGraphStepInput<TEntry>Returns#
data
TEntry extends never ? RemoteQueryEntryPoints[TEntry<TEntry>][] : any[] | WorkflowData<TEntry extends never ? RemoteQueryEntryPoints[TEntry<TEntry>][] : any[]>
data
TEntry extends never ? RemoteQueryEntryPoints[TEntry<TEntry>][] : any[] | WorkflowData<TEntry extends never ? RemoteQueryEntryPoints[TEntry<TEntry>][] : any[]>GraphResultSet
GraphResultSet<TEntry>
GraphResultSet
GraphResultSet<TEntry>WorkflowDataProperties
WorkflowDataProperties<GraphResultSet<TEntry>>
WorkflowDataProperties
WorkflowDataProperties<GraphResultSet<TEntry>>config
(config: { name?: string } & Omit<TransactionStepsDefinition, "next" | "uuid" | "action">) => WorkflowData<GraphResultSet<TEntry>>StepFunctionReturnConfig
StepFunctionReturnConfig<GraphResultSet<TEntry>>
StepFunctionReturnConfig
StepFunctionReturnConfig<GraphResultSet<TEntry>>metadata
RemoteQueryFunctionReturnPagination | WorkflowData<undefined | RemoteQueryFunctionReturnPagination>Optional
metadata
RemoteQueryFunctionReturnPagination | WorkflowData<undefined | RemoteQueryFunctionReturnPagination>OptionaluseRemoteQueryStep#
This step fetches data across modules using the remote query.
Learn more in the Remote Query documentation.
Example#
To retrieve a list of records of a data model:
1import {2 createWorkflow3} from "@medusajs/framework/workflows-sdk"4import {5 useRemoteQueryStep6} from "@medusajs/medusa/core-flows"7 8const helloWorldWorkflow = createWorkflow(9 "hello-world",10 () => {11 const products = useRemoteQueryStep({12 entry_point: "product",13 fields: [14 "*",15 "variants.*"16 ]17 })18 }19)
To retrieve a single item instead of a an array:
1import {2 createWorkflow3} from "@medusajs/framework/workflows-sdk"4import {5 useRemoteQueryStep6} from "@medusajs/core-flows"7 8const helloWorldWorkflow = createWorkflow(9 "hello-world",10 () => {11 const product = useRemoteQueryStep({12 entry_point: "product",13 fields: [14 "*",15 "variants.*"16 ],17 variables: {18 filters: {19 id: "123"20 }21 },22 list: false23 })24 }25)
To throw an error if a record isn't found matching the specified ID:
1import {2 createWorkflow3} from "@medusajs/framework/workflows-sdk"4import {5 useRemoteQueryStep6} from "@medusajs/core-flows"7 8const helloWorldWorkflow = createWorkflow(9 "hello-world",10 () => {11 const product = useRemoteQueryStep({12 entry_point: "product",13 fields: [14 "*",15 "variants.*"16 ],17 variables: {18 filters: {19 id: "123"20 }21 },22 list: false,23 throw_if_key_not_found: true24 })25 }26)
Input#
EntryStepInput | ServiceStepInput
EntryStepInput | ServiceStepInput
EntryStepInput | ServiceStepInput
EntryStepInput | ServiceStepInput