Skip to main content
POST
/
workflows
Create workflow
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
}
'
{
  "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": {}
    }
  ]
}

Documentation Index

Fetch the complete documentation index at: https://docs.eachlabs.ai/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

X-API-Key
string
header
required

API key for authentication

Body

application/json
name
string
required

Human-readable workflow name

Example:

"Text to Image Generator"

description
string
required

Detailed description of what the workflow does

Example:

"Generates images from text prompts using AI models"

definition
object
required

The workflow definition containing steps, input schema, and metadata. This follows the workflow DSL format.

categories
string[]

List of category slugs to organize the workflow

Example:
["image-generation", "ai"]
locked
boolean
default:false

Whether the workflow is locked from modifications

production
boolean
default:false

Whether this is a production workflow

Response

Workflow created successfully

Complete workflow information including all versions

workflow_id
string<uuid>
required

Unique workflow identifier

Example:

"50741f40-8621-4d46-8a91-dff4d873be98"

name
string
required

Human-readable workflow name

Example:

"Text to Image Generator"

description
string
required

Workflow description

Example:

"Generates images from text prompts"

slug
string

URL-friendly workflow identifier

Example:

"text-to-image-generator"

categories
string[]

Category slugs

Example:
["image-generation", "ai"]
locked
boolean

Whether workflow is locked

Example:

false

production
boolean

Whether this is a production workflow

Example:

false

latest_version_id
string

Most recently updated version ID

Example:

"v2"

status
enum<string>

Workflow lifecycle status

Available options:
active,
archived,
deleted
Example:

"active"

trigger_count
integer

Total number of times this workflow has been triggered

Example:

42

created_at
string<date-time>

RFC3339 timestamp when workflow was created

Example:

"2025-12-01T10:00:00Z"

updated_at
string<date-time>

RFC3339 timestamp when workflow was last updated

Example:

"2025-12-07T15:30:00Z"

versions
object[]

List of all versions for this workflow

Last modified on May 28, 2026