To state or not to state? #660
-
Hi there, I'm super new to Serverless DSL and I have the following question. In the example 'Event based greeting' there is a single state that is triggered by an event which then executes an action I was wondering if the following alternative would be acceptable and if not why?
I guess my question is when should I group my actions under one state vs spreading them to different states? It feels like I am misunderstanding something very fundamental so I hope someone can help me! Thank you |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi there! Sorry for the long winter I hope you can still see value on my answer.
There's no correct answer. You can group actions in a state when it makes sense to you. For example, when the actions complement each other. In the new DSL, each task is responsible for a single operation: do:
- task1
- task2
- task3 In your example, you would have a Check out our example directories to get an idea: https://github.com/serverlessworkflow/specification/tree/main/examples |
Beta Was this translation helpful? Give feedback.
Hi there! Sorry for the long winter I hope you can still see value on my answer.
There's no correct answer. You can group actions in a state when it makes sense to you. For example, when the actions complement each other.
In the new DSL, each task is responsible for a single operation:
In your example, you would have a
l…