Workflows

Create a workflow

Create a new workflow owned by the authenticated user.

Authentication: Required.

Common Use Cases:

  • Save a newly built workflow
  • Programmatically provision workflows

Note: Workflow names must be unique within your namespace. Creating a workflow with a name you already use returns a 400 validation error.

post/workflows

Request body

namestring required

Unique workflow name/slug within the user's namespace

titlestring required

Human-readable workflow title

is_publicboolean

Whether the workflow is publicly visible

Example request

{
  "name": "my-image-workflow",
  "title": "My Image Generation Workflow",
  "contents": {
    "name": "my-image-workflow",
    "version": "1.0.0",
    "nodes": {
      "node_a1b2c3": {
        "id": "node_a1b2c3",
        "type": "run",
        "app": "fal-ai/flux/dev",
        "depends": [],
        "input": {
          "prompt": "$input.prompt"
        },
        "metadata": {
          "position": {
            "x": 300,
            "y": 100
          }
        }
      }
    },
    "output": {
      "image": "$node_a1b2c3.images.0.url"
    },
    "schema": {
      "input": {
        "prompt": {
          "type": "string"
        }
      },
      "output": {
        "image": {
          "type": "string"
        }
      }
    }
  }
}

Response

Successfully created workflow

Example response

{
  "workflow": {
    "name": "my-image-workflow",
    "title": "My Image Generation Workflow",
    "user_nickname": "johndoe",
    "created_at": "2024-01-15T10:30:00Z",
    "is_public": true,
    "contents": {
      "nodes": {
        "node_a1b2c3": {
          "id": "node_a1b2c3",
          "type": "model",
          "app": "fal-ai/flux/dev",
          "depends": [],
          "input": {
            "prompt": "$input.prompt"
          },
          "metadata": {
            "position": {
              "x": 300,
              "y": 100
            }
          }
        },
        "output": {
          "id": "output",
          "type": "output",
          "depends": [
            "node_a1b2c3"
          ],
          "fields": {
            "image": "$node_a1b2c3.images.0.url"
          },
          "metadata": {
            "position": {
              "x": 600,
              "y": 100
            }
          }
        }
      }
    }
  }
}

Changes