curl --request POST \
--url https://workflows.eachlabs.run/api/v1/workflows \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "Text to Image Generator",
"description": "Generates images from text prompts using AI models",
"definition": {
"version": "v1",
"steps": [
{
"step_id": "step1",
"type": "model",
"model": "openai-chatgpt-5",
"params": {
"system_prompt": "You are a helpful assistant",
"user_prompt": "{{inputs.prompt}}"
},
"fallback": {
"enabled": true,
"model": "anthropic-claude-4",
"params": {
"system_prompt": "You are a helpful assistant",
"user_prompt": "{{inputs.prompt}}"
}
}
}
],
"input_schema": {
"type": "object",
"properties": {
"prompt": {
"type": "string",
"description": "Text prompt for generation"
}
},
"required": [
"prompt"
]
},
"metadata": {
"output_mapping": {
"result": "{{step1.output}}"
}
}
},
"categories": [
"image-generation",
"ai"
],
"locked": false,
"production": false
}
'import requests
url = "https://workflows.eachlabs.run/api/v1/workflows"
payload = {
"name": "Text to Image Generator",
"description": "Generates images from text prompts using AI models",
"definition": {
"version": "v1",
"steps": [
{
"step_id": "step1",
"type": "model",
"model": "openai-chatgpt-5",
"params": {
"system_prompt": "You are a helpful assistant",
"user_prompt": "{{inputs.prompt}}"
},
"fallback": {
"enabled": True,
"model": "anthropic-claude-4",
"params": {
"system_prompt": "You are a helpful assistant",
"user_prompt": "{{inputs.prompt}}"
}
}
}
],
"input_schema": {
"type": "object",
"properties": { "prompt": {
"type": "string",
"description": "Text prompt for generation"
} },
"required": ["prompt"]
},
"metadata": { "output_mapping": { "result": "{{step1.output}}" } }
},
"categories": ["image-generation", "ai"],
"locked": False,
"production": False
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Text to Image Generator',
description: 'Generates images from text prompts using AI models',
definition: {
version: 'v1',
steps: [
{
step_id: 'step1',
type: 'model',
model: 'openai-chatgpt-5',
params: {system_prompt: 'You are a helpful assistant', user_prompt: '{{inputs.prompt}}'},
fallback: {
enabled: true,
model: 'anthropic-claude-4',
params: {system_prompt: 'You are a helpful assistant', user_prompt: '{{inputs.prompt}}'}
}
}
],
input_schema: {
type: 'object',
properties: {prompt: {type: 'string', description: 'Text prompt for generation'}},
required: ['prompt']
},
metadata: {output_mapping: {result: '{{step1.output}}'}}
},
categories: ['image-generation', 'ai'],
locked: false,
production: false
})
};
fetch('https://workflows.eachlabs.run/api/v1/workflows', 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://workflows.eachlabs.run/api/v1/workflows",
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' => 'Text to Image Generator',
'description' => 'Generates images from text prompts using AI models',
'definition' => [
'version' => 'v1',
'steps' => [
[
'step_id' => 'step1',
'type' => 'model',
'model' => 'openai-chatgpt-5',
'params' => [
'system_prompt' => 'You are a helpful assistant',
'user_prompt' => '{{inputs.prompt}}'
],
'fallback' => [
'enabled' => true,
'model' => 'anthropic-claude-4',
'params' => [
'system_prompt' => 'You are a helpful assistant',
'user_prompt' => '{{inputs.prompt}}'
]
]
]
],
'input_schema' => [
'type' => 'object',
'properties' => [
'prompt' => [
'type' => 'string',
'description' => 'Text prompt for generation'
]
],
'required' => [
'prompt'
]
],
'metadata' => [
'output_mapping' => [
'result' => '{{step1.output}}'
]
]
],
'categories' => [
'image-generation',
'ai'
],
'locked' => false,
'production' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-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://workflows.eachlabs.run/api/v1/workflows"
payload := strings.NewReader("{\n \"name\": \"Text to Image Generator\",\n \"description\": \"Generates images from text prompts using AI models\",\n \"definition\": {\n \"version\": \"v1\",\n \"steps\": [\n {\n \"step_id\": \"step1\",\n \"type\": \"model\",\n \"model\": \"openai-chatgpt-5\",\n \"params\": {\n \"system_prompt\": \"You are a helpful assistant\",\n \"user_prompt\": \"{{inputs.prompt}}\"\n },\n \"fallback\": {\n \"enabled\": true,\n \"model\": \"anthropic-claude-4\",\n \"params\": {\n \"system_prompt\": \"You are a helpful assistant\",\n \"user_prompt\": \"{{inputs.prompt}}\"\n }\n }\n }\n ],\n \"input_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"prompt\": {\n \"type\": \"string\",\n \"description\": \"Text prompt for generation\"\n }\n },\n \"required\": [\n \"prompt\"\n ]\n },\n \"metadata\": {\n \"output_mapping\": {\n \"result\": \"{{step1.output}}\"\n }\n }\n },\n \"categories\": [\n \"image-generation\",\n \"ai\"\n ],\n \"locked\": false,\n \"production\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-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://workflows.eachlabs.run/api/v1/workflows")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Text to Image Generator\",\n \"description\": \"Generates images from text prompts using AI models\",\n \"definition\": {\n \"version\": \"v1\",\n \"steps\": [\n {\n \"step_id\": \"step1\",\n \"type\": \"model\",\n \"model\": \"openai-chatgpt-5\",\n \"params\": {\n \"system_prompt\": \"You are a helpful assistant\",\n \"user_prompt\": \"{{inputs.prompt}}\"\n },\n \"fallback\": {\n \"enabled\": true,\n \"model\": \"anthropic-claude-4\",\n \"params\": {\n \"system_prompt\": \"You are a helpful assistant\",\n \"user_prompt\": \"{{inputs.prompt}}\"\n }\n }\n }\n ],\n \"input_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"prompt\": {\n \"type\": \"string\",\n \"description\": \"Text prompt for generation\"\n }\n },\n \"required\": [\n \"prompt\"\n ]\n },\n \"metadata\": {\n \"output_mapping\": {\n \"result\": \"{{step1.output}}\"\n }\n }\n },\n \"categories\": [\n \"image-generation\",\n \"ai\"\n ],\n \"locked\": false,\n \"production\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://workflows.eachlabs.run/api/v1/workflows")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Text to Image Generator\",\n \"description\": \"Generates images from text prompts using AI models\",\n \"definition\": {\n \"version\": \"v1\",\n \"steps\": [\n {\n \"step_id\": \"step1\",\n \"type\": \"model\",\n \"model\": \"openai-chatgpt-5\",\n \"params\": {\n \"system_prompt\": \"You are a helpful assistant\",\n \"user_prompt\": \"{{inputs.prompt}}\"\n },\n \"fallback\": {\n \"enabled\": true,\n \"model\": \"anthropic-claude-4\",\n \"params\": {\n \"system_prompt\": \"You are a helpful assistant\",\n \"user_prompt\": \"{{inputs.prompt}}\"\n }\n }\n }\n ],\n \"input_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"prompt\": {\n \"type\": \"string\",\n \"description\": \"Text prompt for generation\"\n }\n },\n \"required\": [\n \"prompt\"\n ]\n },\n \"metadata\": {\n \"output_mapping\": {\n \"result\": \"{{step1.output}}\"\n }\n }\n },\n \"categories\": [\n \"image-generation\",\n \"ai\"\n ],\n \"locked\": false,\n \"production\": false\n}"
response = http.request(request)
puts response.read_body{
"workflow_id": "50741f40-8621-4d46-8a91-dff4d873be98",
"name": "Text to Image Generator",
"description": "Generates images from text prompts",
"slug": "text-to-image-generator",
"categories": [
"image-generation",
"ai"
],
"locked": false,
"production": false,
"latest_version_id": "v2",
"status": "active",
"trigger_count": 42,
"created_at": "2025-12-01T10:00:00Z",
"updated_at": "2025-12-07T15:30:00Z",
"versions": [
{
"version_id": "v1",
"slug": "text-to-image-generator",
"locked": false,
"production": true,
"allowed_to_share": false,
"trigger_count": 15,
"created_at": "2025-12-01T10:00:00Z",
"updated_at": "2025-12-05T14:20:00Z",
"status": "active",
"definition": {}
}
]
}{
"error": "<string>"
}{
"error": "<string>"
}Create workflow
Create a new workflow with an initial version and generate its state machine.
This endpoint creates both the workflow metadata and its first version in a single operation. The workflow definition must include at least one step.
curl --request POST \
--url https://workflows.eachlabs.run/api/v1/workflows \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "Text to Image Generator",
"description": "Generates images from text prompts using AI models",
"definition": {
"version": "v1",
"steps": [
{
"step_id": "step1",
"type": "model",
"model": "openai-chatgpt-5",
"params": {
"system_prompt": "You are a helpful assistant",
"user_prompt": "{{inputs.prompt}}"
},
"fallback": {
"enabled": true,
"model": "anthropic-claude-4",
"params": {
"system_prompt": "You are a helpful assistant",
"user_prompt": "{{inputs.prompt}}"
}
}
}
],
"input_schema": {
"type": "object",
"properties": {
"prompt": {
"type": "string",
"description": "Text prompt for generation"
}
},
"required": [
"prompt"
]
},
"metadata": {
"output_mapping": {
"result": "{{step1.output}}"
}
}
},
"categories": [
"image-generation",
"ai"
],
"locked": false,
"production": false
}
'import requests
url = "https://workflows.eachlabs.run/api/v1/workflows"
payload = {
"name": "Text to Image Generator",
"description": "Generates images from text prompts using AI models",
"definition": {
"version": "v1",
"steps": [
{
"step_id": "step1",
"type": "model",
"model": "openai-chatgpt-5",
"params": {
"system_prompt": "You are a helpful assistant",
"user_prompt": "{{inputs.prompt}}"
},
"fallback": {
"enabled": True,
"model": "anthropic-claude-4",
"params": {
"system_prompt": "You are a helpful assistant",
"user_prompt": "{{inputs.prompt}}"
}
}
}
],
"input_schema": {
"type": "object",
"properties": { "prompt": {
"type": "string",
"description": "Text prompt for generation"
} },
"required": ["prompt"]
},
"metadata": { "output_mapping": { "result": "{{step1.output}}" } }
},
"categories": ["image-generation", "ai"],
"locked": False,
"production": False
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Text to Image Generator',
description: 'Generates images from text prompts using AI models',
definition: {
version: 'v1',
steps: [
{
step_id: 'step1',
type: 'model',
model: 'openai-chatgpt-5',
params: {system_prompt: 'You are a helpful assistant', user_prompt: '{{inputs.prompt}}'},
fallback: {
enabled: true,
model: 'anthropic-claude-4',
params: {system_prompt: 'You are a helpful assistant', user_prompt: '{{inputs.prompt}}'}
}
}
],
input_schema: {
type: 'object',
properties: {prompt: {type: 'string', description: 'Text prompt for generation'}},
required: ['prompt']
},
metadata: {output_mapping: {result: '{{step1.output}}'}}
},
categories: ['image-generation', 'ai'],
locked: false,
production: false
})
};
fetch('https://workflows.eachlabs.run/api/v1/workflows', 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://workflows.eachlabs.run/api/v1/workflows",
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' => 'Text to Image Generator',
'description' => 'Generates images from text prompts using AI models',
'definition' => [
'version' => 'v1',
'steps' => [
[
'step_id' => 'step1',
'type' => 'model',
'model' => 'openai-chatgpt-5',
'params' => [
'system_prompt' => 'You are a helpful assistant',
'user_prompt' => '{{inputs.prompt}}'
],
'fallback' => [
'enabled' => true,
'model' => 'anthropic-claude-4',
'params' => [
'system_prompt' => 'You are a helpful assistant',
'user_prompt' => '{{inputs.prompt}}'
]
]
]
],
'input_schema' => [
'type' => 'object',
'properties' => [
'prompt' => [
'type' => 'string',
'description' => 'Text prompt for generation'
]
],
'required' => [
'prompt'
]
],
'metadata' => [
'output_mapping' => [
'result' => '{{step1.output}}'
]
]
],
'categories' => [
'image-generation',
'ai'
],
'locked' => false,
'production' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-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://workflows.eachlabs.run/api/v1/workflows"
payload := strings.NewReader("{\n \"name\": \"Text to Image Generator\",\n \"description\": \"Generates images from text prompts using AI models\",\n \"definition\": {\n \"version\": \"v1\",\n \"steps\": [\n {\n \"step_id\": \"step1\",\n \"type\": \"model\",\n \"model\": \"openai-chatgpt-5\",\n \"params\": {\n \"system_prompt\": \"You are a helpful assistant\",\n \"user_prompt\": \"{{inputs.prompt}}\"\n },\n \"fallback\": {\n \"enabled\": true,\n \"model\": \"anthropic-claude-4\",\n \"params\": {\n \"system_prompt\": \"You are a helpful assistant\",\n \"user_prompt\": \"{{inputs.prompt}}\"\n }\n }\n }\n ],\n \"input_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"prompt\": {\n \"type\": \"string\",\n \"description\": \"Text prompt for generation\"\n }\n },\n \"required\": [\n \"prompt\"\n ]\n },\n \"metadata\": {\n \"output_mapping\": {\n \"result\": \"{{step1.output}}\"\n }\n }\n },\n \"categories\": [\n \"image-generation\",\n \"ai\"\n ],\n \"locked\": false,\n \"production\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-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://workflows.eachlabs.run/api/v1/workflows")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Text to Image Generator\",\n \"description\": \"Generates images from text prompts using AI models\",\n \"definition\": {\n \"version\": \"v1\",\n \"steps\": [\n {\n \"step_id\": \"step1\",\n \"type\": \"model\",\n \"model\": \"openai-chatgpt-5\",\n \"params\": {\n \"system_prompt\": \"You are a helpful assistant\",\n \"user_prompt\": \"{{inputs.prompt}}\"\n },\n \"fallback\": {\n \"enabled\": true,\n \"model\": \"anthropic-claude-4\",\n \"params\": {\n \"system_prompt\": \"You are a helpful assistant\",\n \"user_prompt\": \"{{inputs.prompt}}\"\n }\n }\n }\n ],\n \"input_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"prompt\": {\n \"type\": \"string\",\n \"description\": \"Text prompt for generation\"\n }\n },\n \"required\": [\n \"prompt\"\n ]\n },\n \"metadata\": {\n \"output_mapping\": {\n \"result\": \"{{step1.output}}\"\n }\n }\n },\n \"categories\": [\n \"image-generation\",\n \"ai\"\n ],\n \"locked\": false,\n \"production\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://workflows.eachlabs.run/api/v1/workflows")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Text to Image Generator\",\n \"description\": \"Generates images from text prompts using AI models\",\n \"definition\": {\n \"version\": \"v1\",\n \"steps\": [\n {\n \"step_id\": \"step1\",\n \"type\": \"model\",\n \"model\": \"openai-chatgpt-5\",\n \"params\": {\n \"system_prompt\": \"You are a helpful assistant\",\n \"user_prompt\": \"{{inputs.prompt}}\"\n },\n \"fallback\": {\n \"enabled\": true,\n \"model\": \"anthropic-claude-4\",\n \"params\": {\n \"system_prompt\": \"You are a helpful assistant\",\n \"user_prompt\": \"{{inputs.prompt}}\"\n }\n }\n }\n ],\n \"input_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"prompt\": {\n \"type\": \"string\",\n \"description\": \"Text prompt for generation\"\n }\n },\n \"required\": [\n \"prompt\"\n ]\n },\n \"metadata\": {\n \"output_mapping\": {\n \"result\": \"{{step1.output}}\"\n }\n }\n },\n \"categories\": [\n \"image-generation\",\n \"ai\"\n ],\n \"locked\": false,\n \"production\": false\n}"
response = http.request(request)
puts response.read_body{
"workflow_id": "50741f40-8621-4d46-8a91-dff4d873be98",
"name": "Text to Image Generator",
"description": "Generates images from text prompts",
"slug": "text-to-image-generator",
"categories": [
"image-generation",
"ai"
],
"locked": false,
"production": false,
"latest_version_id": "v2",
"status": "active",
"trigger_count": 42,
"created_at": "2025-12-01T10:00:00Z",
"updated_at": "2025-12-07T15:30:00Z",
"versions": [
{
"version_id": "v1",
"slug": "text-to-image-generator",
"locked": false,
"production": true,
"allowed_to_share": false,
"trigger_count": 15,
"created_at": "2025-12-01T10:00:00Z",
"updated_at": "2025-12-05T14:20:00Z",
"status": "active",
"definition": {}
}
]
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
API key for authentication
Body
Human-readable workflow name
"Text to Image Generator"
Detailed description of what the workflow does
"Generates images from text prompts using AI models"
The workflow definition containing steps, input schema, and metadata. This follows the workflow DSL format.
Show child attributes
Show child attributes
List of category slugs to organize the workflow
["image-generation", "ai"]Whether the workflow is locked from modifications
Whether this is a production workflow
Response
Workflow created successfully
Complete workflow information including all versions
Unique workflow identifier
"50741f40-8621-4d46-8a91-dff4d873be98"
Human-readable workflow name
"Text to Image Generator"
Workflow description
"Generates images from text prompts"
URL-friendly workflow identifier
"text-to-image-generator"
Category slugs
["image-generation", "ai"]Whether workflow is locked
false
Whether this is a production workflow
false
Most recently updated version ID
"v2"
Workflow lifecycle status
active, archived, deleted "active"
Total number of times this workflow has been triggered
42
RFC3339 timestamp when workflow was created
"2025-12-01T10:00:00Z"
RFC3339 timestamp when workflow was last updated
"2025-12-07T15:30:00Z"
List of all versions for this workflow
Show child attributes
Show child attributes