is "use step" really no-op? #31
-
|
https://useworkflow.dev/docs/foundations/workflows-and-steps#step-functions <- here it is mentioned "use step" is essentially no-op. If that's the case would methods like getStepMetadata work when the step function is invoked outside a workflow? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
hey @shyam-king ! From the first link you sent:
The directive |
Beta Was this translation helpful? Give feedback.
-
|
It is a no-op in that most steps will just work since the directive doesn't do anything in regular javascript but, yeah, functions like getStepMetadata will currently throw if you use it in a step when you're not running inside a step. We are considering making it work and basically including a field that lets you know whether or not you're inside a step It's an ongoing design decision, because most of the rest of your step can just work. Even setting |
Beta Was this translation helpful? Give feedback.
It is a no-op in that most steps will just work since the directive doesn't do anything in regular javascript
but, yeah, functions like getStepMetadata will currently throw if you use it in a step when you're not running inside a step.
We are considering making it work and basically including a field that lets you know whether or not you're inside a step
It's an ongoing design decision, because most of the rest of your step can just work. Even setting
maxRetrieson the step will simply become no-ops when using the step outside of workflows