Actions37
- 对话 Actions
- 知识库 Actions
- 集合 Actions
- 数据 Actions
- 应用 Actions
集合 → 创建一个文件集合
AI-generatedSummary
Uploads a binary file from the incoming n8n item to FastGPT and creates a dataset collection from it. FastGPT reads the file and splits it into chunks, via POST /core/dataset/collection/create/localFile.
Inputs
- 文件字段名 (datasetFileField) (required) — Name of the binary property on the input item that holds the file. Supported types: pdf, docx, md, txt, html, csv. The operation throws "文件不能为空" if the item has no binary data.
- 选择知识库 (datasetKnowledgeId) — The target knowledge base, picked from a dropdown. The list is loaded from /core/dataset/list for the given parent folder and shows only items of type dataset. Sent as datasetId.
- 父级目录ID (datasetParentId) — Parent folder ID, copied from the FastGPT browser URL. Sent as parentId. It also determines which knowledge bases the dropdown lists.
- 训练类型 (datasetTrainingType) (required) — Either chunk (split by text length, the default) or qa (QA splitting). Sent as trainingType.
- Chunk长度 (datasetChunkSize) — Chunk size, default 3000. Only shown when the training type is chunk. Sent as chunkSize.
- 自定义最高优先分割符号 (datasetChunkSplitter) — Custom highest-priority split delimiter. Only shown for chunk mode. Sent as chunkSplitter.
- QA拆分自定义提示词 (datasetQAPrompt) — Custom prompt for QA splitting. Only shown for qa mode. Sent as qaPrompt.
- Request Options — Optional node settings: batching (items per batch and interval), ignore SSL issues, proxy, and timeout (default 10000 ms).
Output shape
The parsed JSON response from FastGPT's localFile collection-create endpoint, one result per input item. Expect it to contain the new collection's details, but the source does not define the exact fields.
Errors are raised as NodeApiError if the HTTP status is 4xx or 5xx, or if the response body's code is not 200. The error message comes from the response's message field. The file is sent as multipart form data, with a "file" part and a "data" part holding the JSON settings. The filename is URI-encoded. Each input item must carry its own binary file.
Examples
Example 1: Ingest a PDF downloaded by an HTTP Request node into a knowledge base.
文件字段名=data, 选择知识库=
Example 2: Build Q&A pairs from an uploaded markdown file inside a specific folder.
父级目录ID=