Add CONTEXT
keyword to the workflow definition
#601
-
Hey folks! Similar to what we already have (CONSTANT and SECRETS), I'd like to propose the It should be pretty straightforward, something like: {
"id": "processSalesOrders",
"name": "Process Sales Orders",
"version": "1.0",
"specVersion": "0.8",
"start": "MyStartingState",
"states":[
{
"name":"MyStartingState",
"type":"operation",
"actions": [{
"functionRef": "myFunction"
"args": {
"order": "${ .orderId }",
"callerId": "${ $CONTEXT.workflowInstanceId }"
}
}]
}
]
} As an example use case, sometimes third-party requires specific caller identification for audit/traceability matters. Since each party could have a particular way to identify a caller, users could model how they pleased to fulfill a specific scenario. We won't need to define anything in the schema, but a section highlighting that the wdyt? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
i get the need but this is very runtime specific to my liking. think its just better to let this type of info be part of the runtime that adopts the spec from spec side, we cannot even assume that workflowInstanceId is a json string. it could be an image for some runtimes :) |
Beta Was this translation helpful? Give feedback.
-
we could define a WORKFLOW bucket where users could get the top-level workflow definition properties like workflow id, you could maybe just put that stuff in the default jq ARGS bucket? |
Beta Was this translation helpful? Give feedback.
-
As settled, I will open a PR to add the reserved word @cdavernas @mswiderski thoughts? |
Beta Was this translation helpful? Give feedback.
As settled, I will open a PR to add the reserved word
WORKFLOW
on expressions, so implementations can use it to give meta information of the currently running instance.@cdavernas @mswiderski thoughts?