Skip to content

Input spec

The input spec allows you to define the input parameter structure accepted by the workflow, and the system will automatically validate the input parameters according to the spec.

The input spec uses JSON format to define, containing the following core fields:

{
"version": 2, /* The version number is currently fixed to 2 */
"paramsSchema": { ... }, /* JSON Schema */
"filesInput": { ... }, /* File input configuration */
"examples": [ ... ] /* Example input */
}

The current version number, fixed to 2. This is the recommended version of the input spec format.

Use JSON Schema to define the user-editable parameter structure.

Key properties:

  • type: "object" - The parameter must be an object type
  • properties - Define the fields of each parameter
  • required - Declare the required fields
  • additionalProperties: false - Reject the fields that are not declared

Field type support:

  • string - Text input, supports minLengthmaxLengthpatternenum etc.
  • integer / number - Numerical input, supports minimummaximum etc.
  • boolean - Switch control
  • array - Array type, can nest other types
  • object - Nested object

The file input configuration, containing two input methods:

Allow users to provide a list of file URLs, and the system will automatically download and provide to the workflow.

{
"urlFiles": {
"title": "URL Files",
"description": "One URL per line",
"enabled": true,
"required": false,
"maxItems": 50
}
}

Configuration items:

  • enabled - Whether to enable, default true
  • required - Whether to fill in, default false
  • maxItems - Maximum number of files
  • title - UI display title
  • description - UI description text

Allow users to upload files from their local machine.

{
"uploadFiles": {
"title": "Upload Files",
"description": "Supports PDF and images",
"enabled": true,
"required": false,
"maxItems": 10,
"acceptMime": ["application/pdf", "image/png"]
}
}

Configuration items:

  • enabled - Whether to enable, default true
  • required - Whether to fill in, default false
  • maxItems - Maximum number of files
  • acceptMime - Allowable MIME type list (browser-level prompt, not强制验证)
  • title - UI display title
  • description - UI description text

The example input is used for UI pre-filling and user guidance. It is strongly recommended to configure examples for the input spec.

{
"examples": [
{
"name": "Default search",
"params": { "query": "Maia", "limit": 10 }
},
{
"name": "Deep search",
"params": { "query": "workflow automation", "limit": 50 }
}
]
}

Example fields:

  • name - Example name
  • params - Example parameter values
  • urlFiles - Example URL file list (optional)
  • uploadNotes - Upload file prompt description (optional)

The system will validate the input in the following cases:

  • When creating a task
  • When creating/updating a scheduling rule
  • When updating a batch

If the input parameters do not conform to the spec, the operation will be rejected.

The following top-level key names are reserved by the system, not allowed to be used in the input spec:

  • files - System-managed file metadata
  • upstream - Upstream step outputs
  • urlFiles - System internal use

If the reserved keys are used in paramsSchema.properties or examples[].params, the system will automatically reject the input.

A workflow that does not require file input, such as API calls, data queries, etc.

{
"version": 2,
"paramsSchema": {
"type": "object",
"additionalProperties": false,
"properties": {
"query": {
"type": "string",
"title": "Query keywords",
"minLength": 1
},
"limit": {
"type": "integer",
"title": "Result count",
"minimum": 1,
"maximum": 100,
"default": 10
},
"sort": {
"type": "string",
"title": "Sorting method",
"enum": ["relevance", "date"],
"default": "relevance"
}
},
"required": ["query"]
},
"examples": [
{
"name": "Default",
"params": { "query": "Maia", "limit": 10, "sort": "relevance" }
}
]
}

A workflow that requires processing local files, such as document analysis, image processing, etc.

{
"version": 2,
"paramsSchema": {
"type": "object",
"additionalProperties": false,
"properties": {
"extractImages": {
"type": "boolean",
"title": "Extract images",
"default": false
}
}
},
"filesInput": {
"urlFiles": { "enabled": false },
"uploadFiles": {
"title": "Upload documents",
"description": "Supports PDF and Word documents, up to 5",
"enabled": true,
"required": true,
"maxItems": 5,
"acceptMime": ["application/pdf", "application/msword"]
}
},
"examples": [
{
"name": "Basic extraction",
"params": { "extractImages": false },
"uploadNotes": "Upload the documents to be analyzed"
}
]
}

A workflow that requires batch processing of network resources, such as web scraping, link checking, etc.

{
"version": 2,
"paramsSchema": {
"type": "object",
"additionalProperties": false,
"properties": {
"timeout": {
"type": "integer",
"title": "Request timeout (seconds)",
"minimum": 1,
"maximum": 300,
"default": 30
}
}
},
"filesInput": {
"uploadFiles": { "enabled": false },
"urlFiles": {
"title": "URL list",
"description": "One URL per line, up to 100",
"enabled": true,
"required": true,
"maxItems": 100
}
},
"examples": [
{
"name": "Link checking",
"params": { "timeout": 30 },
"urlFiles": [
{ "url": "https://example.com/page1" },
{ "url": "https://example.com/page2" }
]
}
]
}