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
743 stars 147 forks source link

workflow.id and workflow.key is duplicate #742

Closed lsytj0413 closed 7 months ago

lsytj0413 commented 1 year ago

What would you like to be added:

Only keep one of id or key property in workflow.

Why is this needed:

As the description:

The id property defines the unique, domain-specific workflow identifier, for example "orders", "payment", etc.

The key property defines the unique, domain-specific workflow identifier. It can be used when the id property is auto-generated by a content-management system for example. In these cases, you can specify the key property to be the domain-specific identifier of the workflow definition. The id and key properties are mutually exclusive, meaning you cannot define both.

The id & key property is exclusive,we can only have one of them, but when id is auto-generated (which means it have an value), we cannot define the key property, so the use case is wrong.

tsurdilo commented 1 year ago

hi, i think the community member use case for this was that id is generated by some third party tool like a cms system so it would not be in the workflow definition (thus exclusive). can you describe your use case is the generated id in the json/yaml definition?

lsytj0413 commented 1 year ago

hi, i think the community member use case for this was that id is generated by some third party tool like a cms system so it would not be in the workflow definition (thus exclusive). can you describe your use case is the generated id in the json/yaml definition?

If id is generated by a cms system and not in workflow definition, why we must use another property named key to define the identifier?

As we keep both id and key property, there is some problem:

  1. it's will be confused to the user, they don't know the difference between these two and which property is used in which scenario
  2. if the user have a workflow definition with id=1, and after a period of time change to key=1, Is they are the same identified workflow definition?
github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

cdavernas commented 1 year ago

The way I see and use it, key is used at instantiation time to provide a unique identifier to instances of a workflow based on runtime expressions. The real issues, imho, are:

On a side note, there are many problems with naming conventions, as discussed in related issue #671 , which breaks expression functions, for example

lsytj0413 commented 1 year ago

The way I see and use it, key is used at instantiation time to provide a unique identifier to instances of a workflow based on runtime expressions.

If this is the use case,so user cannot provide it (because runtime will always rewrite it).

tsurdilo commented 1 year ago

did we come to some consensus if we wanna remove this or not?

cdavernas commented 1 year ago

I'm not sure! Let's wait next community meeting if that's ok

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

ricardozanini commented 9 months ago

See https://github.com/serverlessworkflow/specification/discussions/817#discussioncomment-8408714

fjtirado commented 8 months ago

@ricardozanini Working on this one, can you update the status label?