serverlessworkflow / sdk-typescript

Typescript SDK for Serverless Workflow
https://serverlessworkflow.io/
Apache License 2.0
62 stars 16 forks source link

Transition is causing workflow generation to fail #181

Closed brampurnot closed 11 months ago

brampurnot commented 11 months ago

Hi there!

we are trying to generate the SDL specification file from data coming from a database. We managed to get it working pretty nicely except for the transitions.

When we comment out the transition property, the generation works. When we put it back in, we get the following error message: Error: Workflow is invalid: /states/0 | #/else/oneOf/0/required | must have required property 'duration'

The state type is an operation so we don't need a duration in there. On top of that, if we include a duration, then we get the following error: Error: Workflow is invalid: /states/0 | #/else/oneOf | must match exactly one schema in oneOf

Could this be a bug? We are on version 3.0.3.

Bram

brampurnot commented 11 months ago

I was able to fix it :). I was apparently caused because I had: end = false in the first state. Apparently this is not allowed and should be removed.