Workflow details

Inspect the saved definition and registry metadata.

‹ Workflows

ferrisflow.content-types · content-types-create

Create content type definitions

ActiveEdit workflow

Registry record

Workflow ID
#2
Version
v1
Created
2026-11-17
Last updated
2026-11-17
Status
Active

OWS definition

Normalized document stored by the REST API

JSON
{
  "do": [
    {
      "definition": {
        "set": {
          "definition": "${ .definition // .request.body // . }"
        }
      }
    },
    {
      "createTable": {
        "call": "ferrisflow.primitive",
        "input": {
          "schema": {
            "document": {
              "properties": {
                "definition": {
                  "properties": {
                    "display_name": {
                      "minLength": 1,
                      "type": "string"
                    },
                    "schema": {
                      "properties": {
                        "fields": {
                          "items": {
                            "properties": {
                              "label": {
                                "minLength": 1,
                                "type": "string"
                              },
                              "name": {
                                "pattern": "^[A-Za-z][A-Za-z0-9_]*$",
                                "type": "string"
                              },
                              "type": {
                                "enum": [
                                  "text",
                                  "richtext",
                                  "number",
                                  "boolean",
                                  "date",
                                  "email",
                                  "json",
                                  "enum",
                                  "integer"
                                ]
                              }
                            },
                            "required": [
                              "name",
                              "label",
                              "type"
                            ],
                            "type": "object"
                          },
                          "minItems": 1,
                          "type": "array"
                        }
                      },
                      "required": [
                        "fields"
                      ],
                      "type": "object"
                    },
                    "uid": {
                      "pattern": "^[A-Za-z][A-Za-z0-9_]{0,63}$",
                      "type": "string"
                    }
                  },
                  "required": [
                    "uid",
                    "display_name",
                    "schema"
                  ],
                  "type": "object"
                }
              },
              "required": [
                "definition"
              ],
              "type": "object"
            },
            "format": "json"
          }
        },
        "with": {
          "columns": "${ [{name: \"id\", type: \"integer\", primaryKey: true}] + (.definition.schema.fields | map({name: .name, type: (if .type == \"integer\" then \"integer\" else if .type == \"number\" then \"number\" else if .type == \"boolean\" then \"boolean\" else \"string\" end end end), required: (.required // false), unique: (.unique // false)})) }",
          "input": "${ . }",
          "operation": "ensure",
          "primitive": "database",
          "returnInput": true,
          "table": "${ .definition.uid }"
        }
      }
    },
    {
      "registerType": {
        "call": "ferrisflow.primitive",
        "with": {
          "input": "${ {uid: .definition.uid, display_name: .definition.display_name, schema: .definition.schema} }",
          "jsonFields": {
            "schema": "schema_json"
          },
          "operation": "upsert",
          "primaryKey": "uid",
          "primitive": "database",
          "returnInput": true,
          "table": "content_types"
        }
      }
    },
    {
      "createCrudWorkflows": {
        "run": {
          "workflow": {
            "input": "${ . }",
            "name": "content-type-crud",
            "namespace": "ferrisflow_core",
            "version": "1.0.0"
          }
        }
      }
    }
  ],
  "document": {
    "dsl": "1.0.3",
    "metadata": {
      "ferrisflow": {
        "description": "Create content type definitions",
        "name": "Create content type",
        "operation": "create",
        "plugin": "ferrisflow.content-types"
      },
      "rest_api": {
        "enabled": true,
        "method": "POST",
        "path": "/api/content-type-registry"
      },
      "ui": {
        "input_schema": {
          "properties": {
            "display_name": {
              "placeholder": "Article",
              "title": "Display name",
              "type": "string"
            },
            "schema": {
              "title": "Fields schema",
              "type": "object"
            },
            "uid": {
              "placeholder": "article",
              "title": "API ID",
              "type": "string"
            }
          },
          "required": [
            "uid",
            "display_name",
            "schema"
          ],
          "type": "object"
        },
        "view": {
          "config": {
            "description": "Define the collection and its fields.",
            "title": "Content type"
          },
          "type": "form"
        }
      }
    },
    "name": "content-types-create",
    "namespace": "ferrisflow_core",
    "version": "1.0.0"
  }
}