Input & Output Nodes

Applies to: ChengOS v0.2.0+ | Last verified: 2026-09-25 | Source: crates/cheng-nodes/src/nodes/builtin/io

These are the nodes that put data into a workflow. io/input_text carries literal text or a JSON literal you type into the canvas; io/file_upload turns an upload into durable artifact references; io/read_file reads a path the server can already see. The distinction that matters is inline value versus artifact: an artifact port hands downstream nodes a reference instead of the bytes, so large payloads never travel through the execution record. io/file_upload deliberately does no OCR, parsing, or transcription — it routes each upload to a typed artifact port and leaves the conversion to the media nodes.

Text Input — io/input_text

Multi-line text / JSON input, outputs text, JSON value and AgentContext

Inputs

FieldTypeRequiredDefaultDescription
textstring—""Plain text content (supports multi-line input). Control: textarea
json_textstring—""JSON format content (ignored when empty). Control: code-editor

Outputs

FieldTypeDescription
textstringRaw content of the text field (String)
lengthintegerCharacter length of the text field (Number)
json_valueanyParsed result of json_text (null if JSON is invalid)
contextobject (port)AgentContext output (can connect directly to Agent / Output nodes). Connection port, not a form field.

File Upload — io/file_upload

Route uploaded files to durable artifact references for documents, images, audio and video. OCR/parsing/transcription are dedicated downstream nodes.

Inputs

FieldTypeRequiredDefaultDescription
files_jsonarray<any> | object | string—nullUpload files via picker or drag-and-drop; returns artifact references. Control: file-upload
allowed_categoryenum—autoRestrict allowed file category. Control: select. Options: auto (自动检测), image (图片), document (文档), audio (音频), video (视频), other (其他)
max_file_size_mbinteger—50Maximum size per file (MB). Control: number
enable_ocrboolean—falseDeprecated and ignored. Connect image_artifact to io/ocr instead. Control: switch
parse_documentsboolean—falseDeprecated and ignored. Connect document_artifact to io/document_to_text instead. Control: switch
llm_inline_max_bytesinteger—0已废弃:不再产生需要离线存储的内联正文。保留以兼容旧工作流字段。

Outputs

FieldTypeDescription
artifactsarray<object> (port)All uploaded files as durable artifact references. Connection port, not a form field.
first_artifactobject (port)Reference to the first uploaded file. Connection port, not a form field.
document_artifactobject (port)First document artifact; connect to io/document_to_text.artifact. Connection port, not a form field.
image_artifactobject (port)First image artifact; connect to io/ocr.artifact. Connection port, not a form field.
audio_artifactobject (port)First audio artifact; connect to io/speech_to_text.artifact. Connection port, not a form field.
video_artifactobject (port)First video artifact; connect to io/video_extract_audio.artifact. Connection port, not a form field.
file_countintegerNumber of files routed
total_sizeintegerTotal size of all files (bytes)
errorsarray<string>Error messages during processing
llm_textstring (port)Bounded manifest (filename, type, size, artifact URI) for ai/llm.user_message. Connection port, not a form field.
document_base64stringDeprecated: see document_artifact. Always None.
document_filenamestringDeprecated. Always None.
document_textstringDeprecated. Always None.
audio_base64stringDeprecated: see audio_artifact. Always None.
audio_filenamestringDeprecated. Always None.
video_file_pathstringDeprecated: see video_artifact. Always None.
image_base64stringDeprecated: see image_artifact. Always None.
image_filenamestringDeprecated. Always None.
file_pathsstringDeprecated. Always None.
chat_input_rawstringDeprecated. Always None.
user_message_richobjectDeprecated: rich multimodal parts are materialized at the LLM node. Always None.
ocr_textstringDeprecated: OCR is a dedicated node now. Always None.
ocr_structured_jsonstringDeprecated. Always None.
ocr_statusstringDeprecated. Always None.
ocr_results_jsonstringDeprecated. Always None.

Read File — io/read_file

Read a bounded range of a file as plain text from an artifact reference or local path. Connect to LLM text inputs.

Inputs

FieldTypeRequiredDefaultDescription
artifactobject (port)—nullArtifact reference to read (preferred over file_path). Connection port, not a form field.
file_pathstring—nullAbsolute or relative local path (legacy; mutually exclusive with artifact). Control: text
prefixstring—nullOptional prefix prepended to content
suffixstring—nullOptional suffix appended to content
start_byteinteger—0Byte offset to start reading from
max_bytesinteger—16384Maximum bytes to read in this window (default 16 KiB, hard cap 1 MiB)
start_lineinteger—null1-based start line (enables line mode)
max_linesinteger—nullMaximum lines to read in line mode

Outputs

FieldTypeDescription
contentstringBounded plain-text content (with prefix/suffix)
source_artifactobjectArtifact that was read, if any
bytes_readinteger实际读取的字节数
total_bytesinteger文件总字节数
truncatedbooleanWhether more content exists beyond this window
file_pathstringResolved path (legacy file_path input only)
errorstring错误信息;成功时为 null

Next steps