Create Workflow
curl --request POST \
--url https://{api-address}.org.machina.gg/workflow \
--header 'Content-Type: application/json' \
--header 'x-api-token: <api-key>' \
--data '
{
"name": "<string>",
"title": "<string>",
"description": "<string>",
"context-variables": {},
"inputs": {},
"tasks": [
{
"name": "<string>",
"description": "<string>",
"condition": "<string>",
"inputs": {},
"outputs": {}
}
],
"status": "active"
}
'import requests
url = "https://{api-address}.org.machina.gg/workflow"
payload = {
"name": "<string>",
"title": "<string>",
"description": "<string>",
"context-variables": {},
"inputs": {},
"tasks": [
{
"name": "<string>",
"description": "<string>",
"condition": "<string>",
"inputs": {},
"outputs": {}
}
],
"status": "active"
}
headers = {
"x-api-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
title: '<string>',
description: '<string>',
'context-variables': {},
inputs: {},
tasks: [
{
name: '<string>',
description: '<string>',
condition: '<string>',
inputs: {},
outputs: {}
}
],
status: 'active'
})
};
fetch('https://{api-address}.org.machina.gg/workflow', 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-address}.org.machina.gg/workflow",
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>',
'title' => '<string>',
'description' => '<string>',
'context-variables' => [
],
'inputs' => [
],
'tasks' => [
[
'name' => '<string>',
'description' => '<string>',
'condition' => '<string>',
'inputs' => [
],
'outputs' => [
]
]
],
'status' => 'active'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-token: <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-address}.org.machina.gg/workflow"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"context-variables\": {},\n \"inputs\": {},\n \"tasks\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"condition\": \"<string>\",\n \"inputs\": {},\n \"outputs\": {}\n }\n ],\n \"status\": \"active\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-token", "<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-address}.org.machina.gg/workflow")
.header("x-api-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"context-variables\": {},\n \"inputs\": {},\n \"tasks\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"condition\": \"<string>\",\n \"inputs\": {},\n \"outputs\": {}\n }\n ],\n \"status\": \"active\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{api-address}.org.machina.gg/workflow")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"context-variables\": {},\n \"inputs\": {},\n \"tasks\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"condition\": \"<string>\",\n \"inputs\": {},\n \"outputs\": {}\n }\n ],\n \"status\": \"active\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"_id": "<string>"
},
"status": true
}Workflows
Create Workflow
Create a new workflow and configure its parameters.
POST
/
workflow
Create Workflow
curl --request POST \
--url https://{api-address}.org.machina.gg/workflow \
--header 'Content-Type: application/json' \
--header 'x-api-token: <api-key>' \
--data '
{
"name": "<string>",
"title": "<string>",
"description": "<string>",
"context-variables": {},
"inputs": {},
"tasks": [
{
"name": "<string>",
"description": "<string>",
"condition": "<string>",
"inputs": {},
"outputs": {}
}
],
"status": "active"
}
'import requests
url = "https://{api-address}.org.machina.gg/workflow"
payload = {
"name": "<string>",
"title": "<string>",
"description": "<string>",
"context-variables": {},
"inputs": {},
"tasks": [
{
"name": "<string>",
"description": "<string>",
"condition": "<string>",
"inputs": {},
"outputs": {}
}
],
"status": "active"
}
headers = {
"x-api-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
title: '<string>',
description: '<string>',
'context-variables': {},
inputs: {},
tasks: [
{
name: '<string>',
description: '<string>',
condition: '<string>',
inputs: {},
outputs: {}
}
],
status: 'active'
})
};
fetch('https://{api-address}.org.machina.gg/workflow', 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-address}.org.machina.gg/workflow",
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>',
'title' => '<string>',
'description' => '<string>',
'context-variables' => [
],
'inputs' => [
],
'tasks' => [
[
'name' => '<string>',
'description' => '<string>',
'condition' => '<string>',
'inputs' => [
],
'outputs' => [
]
]
],
'status' => 'active'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-token: <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-address}.org.machina.gg/workflow"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"context-variables\": {},\n \"inputs\": {},\n \"tasks\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"condition\": \"<string>\",\n \"inputs\": {},\n \"outputs\": {}\n }\n ],\n \"status\": \"active\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-token", "<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-address}.org.machina.gg/workflow")
.header("x-api-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"context-variables\": {},\n \"inputs\": {},\n \"tasks\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"condition\": \"<string>\",\n \"inputs\": {},\n \"outputs\": {}\n }\n ],\n \"status\": \"active\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{api-address}.org.machina.gg/workflow")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"context-variables\": {},\n \"inputs\": {},\n \"tasks\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"condition\": \"<string>\",\n \"inputs\": {},\n \"outputs\": {}\n }\n ],\n \"status\": \"active\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"_id": "<string>"
},
"status": true
}Authorizations
API key authentication
Body
application/json
Unique identifier for the workflow
Display title of the workflow
Detailed description of the workflow's purpose
Configuration settings and API keys for the workflow
Input parameters for the workflow with default values or expressions
Output mappings for the workflow using expressions
Show child attributes
Show child attributes
Array of task definitions that make up the workflow
Show child attributes
Show child attributes
Current status of the workflow
Available options:
active, inactive ⌘I

