serverlessworkflow / specification

Serverless Workflow Specification
http://serverlessworkflow.io
Apache License 2.0
705 stars 145 forks source link

Context Data Scoping #868

Open cdavernas opened 1 month ago

cdavernas commented 1 month ago

What would you like to be added:

Add a feature to enable scoping $context data.

Why is this needed:

In some specific cases, a user might want to only provide a slice of its context data to sub tasks, which is especially true when performing iterations (for/while) to avoid useless bloating.

It is also true for parallel writes, which you'd rather have on a small slice of a potentially huge context than on its whole. Google Workflows addresses that by explicitly sharing variables.

fjtirado commented 1 month ago

I think that to properly discuss this we need a pointer to the current section of the doc where $context and variable scoping is discussed.

fjtirado commented 1 month ago

I opened dicussion https://github.com/serverlessworkflow/specification/discussions/890. I think we need to discuss a few thing before considering this case.