CNCF Functions Support
The Rapid Adapter Builder platform supports expressions from the Cloud Native Computing Foundation (CNCF) functions.
Adapter developers can use jq expression language while building flows using Cloud Native Computing Foundation (CNCF) functions.
Sample code to define a CNCF function:
"functions": [
{
"name": "extractWebhookIdFunc",
"operation": "[{fileId: .configuration.fileId, webhook: .entries[]}] | map(select(.webhook.target.id==.fileId)) | .[0].webhook.id",
"type": "expression"
}
],
Sample code to implement the CNCF function:
"states": [
{
"actions": [
{
"functionRef": {
"refName": "extractWebhookIdFunc"
},
"actionDataFilter": {
"toStateData": "${ .webhookId }"
}
}
]
}
]
The Rapid Adapter Builder platform supports the following constructs of the Serverless Workflow specification:
Workflow Constructs
This table shows the supported operations in the CNCF workflow function.
Operation | Details |
---|---|
specVersion |
Indicates the supported version of the Serverless Workflow specification. The Rapid Adapter Builder platform supports 0.8 version. |
functions |
A unique function name that follows the serverless workflow naming convention. |
states |
States dictate the control flow logic instructions of a workflow. |
Function Definitions
This table shows the supported operations in the CNCF function definition.
Operation | Details |
---|---|
expression |
The expression operation. |
custom |
A property that defines a list of function types that are set by the specification. |
State Definitions
This table shows the supported operations in the state definition.
Operation | Details |
---|---|
functionRef |
Defines the name of the referenced function. This can be either a string or an object. |
actionDataFilter |
A filter that you can use within an action. |
condition |
The condition operation. |
Operation State
This table shows the supported operations in the CNCF operation state.
Operation | Details |
---|---|
Multiple actions |
Supports multiple actions. |
transition |
One or more incoming or outgoing transitions of a serverless workflow state. |
end |
A boolean or object type. |
Switch State
This table shows the supported operations in the CNCF switch state.
Operation | Details |
---|---|
dataConditions |
A data-based condition statement. When evaluated to true causes a transition to a predefined workflow state. |
defaultCondition |
A switch state that enables the default transition of a workflow when there are no matching data conditions or if an event timeout occurs. |
State Actions
This table shows the supported operations in the CNCF state actions.
Operation | Details |
---|---|
Operation State |
A set of actions that are performed in sequence or in parallel. State transition occurs once all the actions are completed. |
Switch State |
A workflow gateway that directs transition of workflows based on defined conditions. |