Supported Custom CNCF Serverless Workflow
The Rapid Adapter Builder platform supports a subset of the constructs that are supported in the Serverless Workflow specification of the Cloud Native Computing Foundation (CNCF) project.
Each input argument to a function can be a JSON node, string, or jq expression, and follows the CNCF syntax.
connectivity::rest
This function is an outbound HTTP call. By default, it uses the configured security policy. Values for arguments can be valid jq expressions.
This table describes JSON node input format for this function.
Input object | Description |
---|---|
uri |
This is the Outbound URL. |
method |
This is the HTTP method. |
headers |
(Optional) Set the headers where the JSON node is the key header name, and the value is a string or array of header value(s). |
parameters |
(Optional) This is a collection of path or query parameters, or both. |
body |
(Optional) This is the outbound request payload. |
skipPolicy |
(Optional) This is a boolean value, set by default to Set it to |
requestMediaType |
(Optional) Use this to override the default connectivity::rest behavior to process request media like structured (JSON), binary, multipart, and form-urlencoded. |
responseMediaType |
(Optional) Use this to override the default connectivity::rest behavior to process response media like structured (JSON), binary, multipart, and form-urlencoded. |
This table describes JSON node output format for this function.
Response/output object for connectivity::rest | Description |
---|---|
headers |
This is the response header, where the JSON node is the key header name, and the value is a string or array of header values. |
status |
This is the response status. It is an integer. |
body |
This is the outbound response payload. |
Sample code:
"functions": [
{
"name": "createTaskListFunction",
"type": "custom",
"operation": "connectivity::rest"
}
],
"states":[
{
...
"actions":[
{
"functionRef": {
"refName": "createTaskListFunction",
"arguments": {
"uri": <String/JQ expression>,
"method": <String/JQ expression>,
"headers": <Object/JQ expression>",
"parameters": "<Object/JQ expression>,
"body": <Object/String/JQ>",
"skipPolicy": boolean
}
},
"actionDataFilter": {
"results": "${ {body: .body, headers: .headers, status: .status} }",
..
}
}
],
....
}
connectivity::log
This function logs a message at the specified level.
This table describes the input arguments for this function.
Input argument | Description |
---|---|
|
This is the message to log. |
|
This is the level at which to log the message. The value can be |
Note:
DEBUG mode publishes the message to the activity stream.Sample code:
"functions": [
{
"name": "logFunction",
"type": "custom",
"operation": "connectivity::log"
}
],
"states":[
{
...
"actions":[
{
"functionRef": {
"refName": "logFunction",
"arguments": {
"message": <String/JQ expression>
}
}
}
],
....
}
connectivity::avroSchemaToJsonSchema
This function converts the AVRO schema to JSON schema.
This table describes the input arguments for this function.
Input | Example Value |
---|---|
|
|
Sample output:
{
"type" : "object",
"required" : [ "name", "age", "email" ],
"properties" : {
"name" : {
"type" : "string"
},
"age" : {
"type" : "integer"
},
"email" : {
"type" : "string"
}
}
}
Sample code:
"functions": [
{
"name": "dynamicAvroSchema",
"type": "custom",
"operation": "connectivity::avroSchemaToJsonSchema"
}
],
"states": [
{
...
"actions": [
{
"functionRef": {
"refName":"dynamicAvroSchema",
"arguments": {
"avroSchema": <String/JQ expression> }
},
"actionDataFilter": {
"toStateData":
<JQ expression>
}
}
]
}
connectivity::avroEncode
This function converts the JSON data corresponding to the AVRO schema to AVRO binary encoded data.
This table describes the input arguments.
Key | Description | Example Value |
---|---|---|
|
AVRO schema (string format). |
|
avroJsonData |
JSON data (string format) corresponding to AVRO schema. |
|
Here is the sample output:
Jane Smith2*janesmith@example.com
Sample code:
"functions": [
{
"name": "avroEncodeFunc",
"operation": "connectivity::avroEncode",
"type": "custom"
}
],
"states": [
{
"actions": [
{
"functionRef": {
"refName":"avroEncodeFunc",
"arguments": {
"avroSchema": "<String/JQ expression>
"avroJsonData": <String/JQ expression>
}
},
"actionDataFilter": {
"toStateData":
<JQ expression>
}
}
}
]
connectivity::avroDecode
This function decodes the AVRO binary encoded data.
This table describes the input argument.
Key | Description | Example Value |
---|---|---|
avroSchema |
AVRO schema (string format), that was converted to JSON schema. |
|
avroEncodedData |
AVRO binary encoded data (text). |
|
Sample output:
{"name":"Jane Smith","age":25,"email":"janesmith@example.com"}
Sample code:
"functions": [
{
"name": "avroDecodeFunc",
"operation": "connectivity::avroDecode",
"type": "custom"
}
],
"states": [
{
"actions": [
{
"functionRef": {
"refName":"avroDecodeFunc",
"arguments": {
"avroSchema": "<String/JQ expression>"
"avroEncodedData": "<String/JQ expression>"
}
},
"actionDataFilter": {
"toStateData":
<JQ expression>
}
}
}
]