Skip to content

Field Types

Minions supports 12 field types. Each type maps to a JSON Schema representation and has specific validation rules.

TypeJS TypeDescription
stringstringShort text value
numbernumberNumeric value
booleanbooleanTrue or false
datestringISO 8601 date-time string
selectstringSingle choice from options
multi-selectstring[]Multiple choices from options
urlstringHTTP/HTTPS URL
emailstringEmail address
textareastringLong-form text
tagsstring[]Array of string tags
jsonanyFree-form JSON value
arrayany[]Generic array

Fields can specify additional constraints via the validation property:

ConstraintApplies ToDescription
minLengthstring, textareaMinimum character count
maxLengthstring, textareaMaximum character count
patternstring, textareaRegex pattern to match
minnumberMinimum value
maxnumberMaximum value
interface FieldDefinition {
name: string; // Field key (required)
type: FieldType; // One of the 12 types (required)
label?: string; // Display label
description?: string; // Help text
required?: boolean; // Default: false
defaultValue?: any; // Applied on creation
options?: string[]; // For select/multi-select
validation?: {
minLength?: number;
maxLength?: number;
min?: number;
max?: number;
pattern?: string;
};
}
{ name: 'code', type: 'string', validation: { minLength: 2, maxLength: 10, pattern: '^[A-Z]+$' } }
{ name: 'strategy', type: 'select', options: ['round_robin', 'parallel', 'sequential'] }
{ name: 'temperature', type: 'number', validation: { min: 0, max: 2 } }