serverlessworkflow / specification

Contains the official specification for the Serverless Workflow Domain Specific Language. It provides detailed guidelines and standards for defining, executing, and managing workflows in serverless environments, ensuring consistency and interoperability across implementations.
http://serverlessworkflow.io
Apache License 2.0
730 stars 146 forks source link

Where to find documentation for workflow states? #916

Closed sandeep-paliwal closed 1 month ago

sandeep-paliwal commented 1 month ago

I was going through https://github.com/serverlessworkflow/specification/blob/main/dsl-reference.md, but I could not find any details about states , actions and functions. Here is a valid sample workflow JSON and I want to understand what all can go in defining

  1. State
  2. Function
  3. actions
{
   "id":"Demo1",
   "version":"1.0.0",
   "specVersion":"0.8",
   "name":"Sample Workflow",
   "description":"A sample workflow",
   "start":"Step1",
   "states":[
      {
         "name":"Step1",
         "type":"operation",
         "actions":[
            {
               "functionRef":{
                  "refName":"doSomething"
               }
            }
         ],
         "end":true
      }
   ],
   "functions":[
      {
         "name":"doSomething",
         "operation":"invoke"
      }
   ]
}
cdavernas commented 1 month ago

@sandeep-paliwal You are not gonna find any documentation regarding states, actions and functions, because those are opiniated and confusing concepts that do not exist anymore, as they have all been replaced with tasks.

Your example would translate as the following in 1.0.0:

document:
  dsl: 1.0.0
  namespace: default
  name: Demo1
  version: 1.0.0
use:
  functions:
    doSomething:
      call: http
      with:
        method: get
        endpoint: https://github.com/serverlessworkflow/specification
do:
  - Step1:
      call: doSomething

I would recommend you check both the examples and the CTK in order to further understand the changes the spec went through.

Does that answer your question?

I'm closing the issue, because it is not a bug, problem or feature request. Please feel free, however, and if need be, to start a new discussion!

JBBianchi commented 1 month ago

@sandeep-paliwal you might be looking for the previous version's documentation https://github.com/serverlessworkflow/specification/tree/0.9.x

sandeep-paliwal commented 1 month ago

Thanks a lot. This is exactly what I was looking for.