feat(workflows-sdk): run, registerStepSuccess and registerStepFailure shortcut (#6164)

**What**

Currently, when exporting a workflow using the workflowExport util, it is mandatory to first call the resulted function passing the container before being able to call run, registerStepSuccess or failure on it. Now, it is possible to either continue that way, or to directly call the run, registerStepSuccess or failure on the exported workflow and at that moment it is possible to pass a container if needed

e.g
```ts
const workflow = exportWorkflow("id" as any, "result_step", prepare)
const wfRunner = workflow(container)
wfRunner.run(...) // Here the container is not expected
```
or
```ts
const workflow = exportWorkflow("id" as any, "result_step", prepare)
workflow.run(...) // Here we can now pass an optional container 
```
This commit is contained in:
Adrien de Peretti authored and GitHub committed 2024-01-22 19:14:18 +00:00
1 parent 4792c55226
commit 738e9115ec
3 files changed
+375 -131

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
---
"@medusajs/workflows-sdk": patch
---
feat(workflows-sdk): run, registerStepSuccess and registerStepFailure shortcut