curl --request POST \
--url https://api.cloudcruise.com/workflow-components \
--header 'Content-Type: application/json' \
--header 'cc-key: <api-key>' \
--data '
{
"name": "<string>",
"componentData": {
"nodes": [
{
"workflowNode": {
"id": "<string>",
"name": "<string>",
"parameters": {},
"description": "<string>"
},
"position": {
"x": 123,
"y": 123
}
}
],
"workflowEdges": {},
"reactFlowEdges": [
{
"sourceId": "<string>",
"targetId": "<string>",
"sourceHandle": "<string>",
"targetHandle": "<string>"
}
],
"vault_schema": {}
}
}
'import requests
url = "https://api.cloudcruise.com/workflow-components"
payload = {
"name": "<string>",
"componentData": {
"nodes": [
{
"workflowNode": {
"id": "<string>",
"name": "<string>",
"parameters": {},
"description": "<string>"
},
"position": {
"x": 123,
"y": 123
}
}
],
"workflowEdges": {},
"reactFlowEdges": [
{
"sourceId": "<string>",
"targetId": "<string>",
"sourceHandle": "<string>",
"targetHandle": "<string>"
}
],
"vault_schema": {}
}
}
headers = {
"cc-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'cc-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
componentData: {
nodes: [
{
workflowNode: {id: '<string>', name: '<string>', parameters: {}, description: '<string>'},
position: {x: 123, y: 123}
}
],
workflowEdges: {},
reactFlowEdges: [
{
sourceId: '<string>',
targetId: '<string>',
sourceHandle: '<string>',
targetHandle: '<string>'
}
],
vault_schema: {}
}
})
};
fetch('https://api.cloudcruise.com/workflow-components', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cloudcruise.com/workflow-components",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'componentData' => [
'nodes' => [
[
'workflowNode' => [
'id' => '<string>',
'name' => '<string>',
'parameters' => [
],
'description' => '<string>'
],
'position' => [
'x' => 123,
'y' => 123
]
]
],
'workflowEdges' => [
],
'reactFlowEdges' => [
[
'sourceId' => '<string>',
'targetId' => '<string>',
'sourceHandle' => '<string>',
'targetHandle' => '<string>'
]
],
'vault_schema' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"cc-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.cloudcruise.com/workflow-components"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"componentData\": {\n \"nodes\": [\n {\n \"workflowNode\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"parameters\": {},\n \"description\": \"<string>\"\n },\n \"position\": {\n \"x\": 123,\n \"y\": 123\n }\n }\n ],\n \"workflowEdges\": {},\n \"reactFlowEdges\": [\n {\n \"sourceId\": \"<string>\",\n \"targetId\": \"<string>\",\n \"sourceHandle\": \"<string>\",\n \"targetHandle\": \"<string>\"\n }\n ],\n \"vault_schema\": {}\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cc-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.cloudcruise.com/workflow-components")
.header("cc-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"componentData\": {\n \"nodes\": [\n {\n \"workflowNode\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"parameters\": {},\n \"description\": \"<string>\"\n },\n \"position\": {\n \"x\": 123,\n \"y\": 123\n }\n }\n ],\n \"workflowEdges\": {},\n \"reactFlowEdges\": [\n {\n \"sourceId\": \"<string>\",\n \"targetId\": \"<string>\",\n \"sourceHandle\": \"<string>\",\n \"targetHandle\": \"<string>\"\n }\n ],\n \"vault_schema\": {}\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cloudcruise.com/workflow-components")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["cc-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"componentData\": {\n \"nodes\": [\n {\n \"workflowNode\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"parameters\": {},\n \"description\": \"<string>\"\n },\n \"position\": {\n \"x\": 123,\n \"y\": 123\n }\n }\n ],\n \"workflowEdges\": {},\n \"reactFlowEdges\": [\n {\n \"sourceId\": \"<string>\",\n \"targetId\": \"<string>\",\n \"sourceHandle\": \"<string>\",\n \"targetHandle\": \"<string>\"\n }\n ],\n \"vault_schema\": {}\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"workspace_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"component_data": {
"nodes": [
{
"workflowNode": {
"id": "<string>",
"name": "<string>",
"parameters": {},
"description": "<string>"
},
"position": {
"x": 123,
"y": 123
}
}
],
"workflowEdges": {},
"reactFlowEdges": [
{
"sourceId": "<string>",
"targetId": "<string>",
"sourceHandle": "<string>",
"targetHandle": "<string>"
}
],
"vault_schema": {}
},
"version_number": 2,
"created_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version_note": "<string>"
}Create workflow component
Creates a new workflow component in the workspace associated with your API key. Components are reusable groups of nodes that can be embedded into many workflows.
The component ID is generated server-side. The initial creation produces version 1. Use PUT /workflow-components/{component_id} to create subsequent versions.
curl --request POST \
--url https://api.cloudcruise.com/workflow-components \
--header 'Content-Type: application/json' \
--header 'cc-key: <api-key>' \
--data '
{
"name": "<string>",
"componentData": {
"nodes": [
{
"workflowNode": {
"id": "<string>",
"name": "<string>",
"parameters": {},
"description": "<string>"
},
"position": {
"x": 123,
"y": 123
}
}
],
"workflowEdges": {},
"reactFlowEdges": [
{
"sourceId": "<string>",
"targetId": "<string>",
"sourceHandle": "<string>",
"targetHandle": "<string>"
}
],
"vault_schema": {}
}
}
'import requests
url = "https://api.cloudcruise.com/workflow-components"
payload = {
"name": "<string>",
"componentData": {
"nodes": [
{
"workflowNode": {
"id": "<string>",
"name": "<string>",
"parameters": {},
"description": "<string>"
},
"position": {
"x": 123,
"y": 123
}
}
],
"workflowEdges": {},
"reactFlowEdges": [
{
"sourceId": "<string>",
"targetId": "<string>",
"sourceHandle": "<string>",
"targetHandle": "<string>"
}
],
"vault_schema": {}
}
}
headers = {
"cc-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'cc-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
componentData: {
nodes: [
{
workflowNode: {id: '<string>', name: '<string>', parameters: {}, description: '<string>'},
position: {x: 123, y: 123}
}
],
workflowEdges: {},
reactFlowEdges: [
{
sourceId: '<string>',
targetId: '<string>',
sourceHandle: '<string>',
targetHandle: '<string>'
}
],
vault_schema: {}
}
})
};
fetch('https://api.cloudcruise.com/workflow-components', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cloudcruise.com/workflow-components",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'componentData' => [
'nodes' => [
[
'workflowNode' => [
'id' => '<string>',
'name' => '<string>',
'parameters' => [
],
'description' => '<string>'
],
'position' => [
'x' => 123,
'y' => 123
]
]
],
'workflowEdges' => [
],
'reactFlowEdges' => [
[
'sourceId' => '<string>',
'targetId' => '<string>',
'sourceHandle' => '<string>',
'targetHandle' => '<string>'
]
],
'vault_schema' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"cc-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.cloudcruise.com/workflow-components"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"componentData\": {\n \"nodes\": [\n {\n \"workflowNode\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"parameters\": {},\n \"description\": \"<string>\"\n },\n \"position\": {\n \"x\": 123,\n \"y\": 123\n }\n }\n ],\n \"workflowEdges\": {},\n \"reactFlowEdges\": [\n {\n \"sourceId\": \"<string>\",\n \"targetId\": \"<string>\",\n \"sourceHandle\": \"<string>\",\n \"targetHandle\": \"<string>\"\n }\n ],\n \"vault_schema\": {}\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cc-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.cloudcruise.com/workflow-components")
.header("cc-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"componentData\": {\n \"nodes\": [\n {\n \"workflowNode\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"parameters\": {},\n \"description\": \"<string>\"\n },\n \"position\": {\n \"x\": 123,\n \"y\": 123\n }\n }\n ],\n \"workflowEdges\": {},\n \"reactFlowEdges\": [\n {\n \"sourceId\": \"<string>\",\n \"targetId\": \"<string>\",\n \"sourceHandle\": \"<string>\",\n \"targetHandle\": \"<string>\"\n }\n ],\n \"vault_schema\": {}\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cloudcruise.com/workflow-components")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["cc-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"componentData\": {\n \"nodes\": [\n {\n \"workflowNode\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"parameters\": {},\n \"description\": \"<string>\"\n },\n \"position\": {\n \"x\": 123,\n \"y\": 123\n }\n }\n ],\n \"workflowEdges\": {},\n \"reactFlowEdges\": [\n {\n \"sourceId\": \"<string>\",\n \"targetId\": \"<string>\",\n \"sourceHandle\": \"<string>\",\n \"targetHandle\": \"<string>\"\n }\n ],\n \"vault_schema\": {}\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"workspace_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"component_data": {
"nodes": [
{
"workflowNode": {
"id": "<string>",
"name": "<string>",
"parameters": {},
"description": "<string>"
},
"position": {
"x": 123,
"y": 123
}
}
],
"workflowEdges": {},
"reactFlowEdges": [
{
"sourceId": "<string>",
"targetId": "<string>",
"sourceHandle": "<string>",
"targetHandle": "<string>"
}
],
"vault_schema": {}
},
"version_number": 2,
"created_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version_note": "<string>"
}Authorizations
API key-based authentication. Provide your CloudCruise API key in the cc-key header.
Headers
CloudCruise API key for authentication
Body
Payload for creating a new workflow component.
Response
Component created successfully
Full workflow component including its latest version's component_data.
Returned by GET /workflow-components/{component_id} and the create endpoint.
Unique identifier for the component
ID of the workspace this component belongs to
Display name of the component
Structural payload for a workflow component — the nodes, edges, and vault schema that compose it. Mirrors the shape used by the workflow visualizer.
Show child attributes
Show child attributes
The latest version number of this component
x >= 1ID of the user who created the component
Optional note describing the latest version's changes
Was this page helpful?

