Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions roadmap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ _Status description:_
| ✔️| Update eventRef props to`resultEventTimeout` and `consumeEventTimeout` [spec doc](https://github.com/serverlessworkflow/specification/blob/main/specification.md#EventRef-Definition) |
| ✔️| Apply fixes to auth spec schema [workflow schema](https://github.com/serverlessworkflow/specification/tree/main/schema) |
| ✔️| Update the `dataInputSchema` top-level property by supporting the assignment of a JSON schema object [workflow schema](https://github.com/serverlessworkflow/specification/tree/main/specification.md#workflow-definition-structure) |
| ✔️| Add the new `WORKFLOW` reserved keyword to workflow expressions |
| ✏️️| Add inline state defs in branches | |
| ✏️️| Update rest function definition | |
| ✏️️| Add "completedBy" functionality | |
Expand Down
39 changes: 39 additions & 0 deletions specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
* [Workflow Constants](#workflow-constants)
* [Workflow Secrets](#workflow-secrets)
* [Workflow Metadata](#workflow-metadata)
* [Workflow Context](#workflow-context)
- [Extensions](#extensions)
- [Use Cases](#use-cases)
- [Examples](#examples)
Expand Down Expand Up @@ -6170,6 +6171,44 @@ Some other examples of information that could be recorded in metadata are:
- Logging, monitoring, analytics, or audit repository information.
- Labels used for organizing/indexing purposes, such as "release" "stable", "track", "daily", etc.

### Workflow Context

Similar to [Constants](https://github.com/serverlessworkflow/specification/blob/main/specification.md#workflow-constants) and [Secrets](https://github.com/serverlessworkflow/specification/blob/main/specification.md#workflow-secrets), workflows expressions can have access to the context information of a running instance via the keyword `WORKFLOW`.

Implementations may use this keyword to give access to any relevant information of the running instance within an expression. For example:

```json

{
"id": "processSalesOrders",
"name": "Process Sales Orders",
"version": "1.0",
"specVersion": "0.8",
"start": "MyStartingState",
"functions": [{
"name": "myFunction",
"operation": "myopenapi.json#myFunction"
}],
"states":[
{
"name":"MyStartingState",
"type":"operation",
"actions": [{
"functionRef": "myFunction",
"args": {
"order": "${ .orderId }",
"callerId": "${ $WORKFLOW.instanceId }"
}
}],
"end": true
}]
}
```

In this use case, a third-party service may require information from the caller for traceability purposes.

The specification doesn't define any specific variable within the `WORKFLOW` bucket, but it's considered a reserved keyword.

## Extensions

The workflow extension mechanism allows you to enhance your model definitions with additional information useful for
Expand Down