Overview
Schemas define the data contract between users and workflows:- Input schemas define what the user fills in before triggering a workflow (forms)
- Output schemas define what the workflow returns after execution (results)
config.ts as part of the workflow configuration.
Input schemas
Input schemas are used by HTTP triggers and sub-workflow triggers to define what data the workflow expects.Structure
An input schema is an array of sections, each containing an array of fields:Field types
| Type | Description | Type-specific properties |
|---|---|---|
string | Single-line text | minLength, maxLength, regex, placeholder |
text | Multi-line text | minLength, maxLength, rows, placeholder |
number | Numeric input | min, max, numberType (integer or float) |
boolean | Toggle/checkbox | defaultValue |
date | Date picker | minDate, maxDate |
select | Single-choice dropdown | options: [{value, label}] |
multiselect | Multi-choice dropdown | options: [{value, label}], minItems, maxItems |
radio | Radio button group | options: [{value, label}] |
file | File upload | maxSize, allowedMimeTypes, maxFiles |
array | Repeatable items | itemField: {type, ...}, minItems, maxItems |
object | Nested fields | fields: [{key, type, ...}] |
objectArray | Repeatable objects | fields: [{key, type, ...}], minItems, maxItems |
Common field properties
| Property | Type | Description |
|---|---|---|
key | string | Unique field identifier (snake_case or CONSTANT_CASE) |
type | string | One of the field types above |
label | string | Display label shown to the user |
description | string | Help text below the field |
placeholder | string | Placeholder text inside the field |
required | boolean | Whether the field must be filled |
defaultValue | any | Pre-filled value |
File upload field
Select field
Array field
Output schemas
Output schemas define the structure of execution results. They apply to all trigger types.Structure
An output schema is a flat array of field definitions:Output field types
| Type | Description | Notes |
|---|---|---|
string | Single-line text | Short text values |
text | Multi-line text | Long-form content, markdown |
number | Numeric value | Use numberType: 'integer' for whole numbers |
boolean | True/false | Binary results |
date | Date value | ISO 8601 format |
file | Uploaded file | References a documentId from Codika Upload File |
array | List of items | Requires itemField with type definition |
Sub-workflow output schema
Sub-workflows always have an empty output schema:Connecting schemas to workflow nodes
Input data in workflows
For HTTP triggers, the user’s form data arrives in the webhook payload. Extract it in a Code node:Output data in workflows
The Codika Submit Result node sends theresultData back. It must match the output schema:
Validation
The CLI validates schemas via theschema-types use-case script:
- All field types are valid
- Required properties are present
itemFieldis defined for array types- Keys use valid naming conventions