Actions37
- 对话 Actions
- 知识库 Actions
- 集合 Actions
- 数据 Actions
- 应用 Actions
集合 → 通过API数据集创建集合(V1)
AI-generatedSummary
Creates a FastGPT knowledge-base collection from a file already present in a FastGPT API dataset, by POSTing the file ID to /core/dataset/collection/create/apiCollection with chunking or QA-split training settings.
Inputs
- datasetParentId — Parent folder ID (copy from the FastGPT browser URL). Sent as body
parentId. It also scopes the knowledge-base dropdown. - datasetKnowledgeId — Target knowledge base, picked from a list loaded via /core/dataset/list (only items of type 'dataset'). Sent as
datasetId. - datasetName (required) — Collection name; the field description suggests using the file name. Sent as
name. - datasetApiFileId (required) — ID of the file already uploaded to the FastGPT API dataset. Sent as
apiFileId. - datasetTrainingType (required) — Training mode: 'chunk' (split by text length, default) or 'qa' (QA split). Sent as
trainingType. - datasetChunkSize — Chunk length, default 3000. Shown only when the training type is chunk. Sent as
chunkSize. - datasetChunkSplitter — Custom highest-priority split symbol. Shown only when the training type is chunk. Sent as
chunkSplitter. - datasetQAPrompt — Custom prompt for QA splitting. Shown only when the training type is qa. Sent as
qaPrompt. - requestOptions — Standard n8n request settings: batching (items per batch, interval), ignore SSL issues, proxy, and timeout (default 10000 ms).
Output shape
The parsed JSON response from the FastGPT API, returned as the node's output item. It is typically the created collection's info, but the source does not define the exact fields.
The request ignores HTTP status errors, then a post-receive handler throws a NodeApiError if the HTTP status is 4xx/5xx or the response body
codeis not 200. The error message comes from the responsemessage. Requires FastGPT API credentials, whose baseUrl is used as the base URL.
Examples
Example 1: Import a document already synced into an API dataset as a chunked collection.
Set the knowledge base, name 'handbook.pdf', API file ID from your file source, training type chunk, chunk size 3000.
Example 2: Build a QA-style collection from an API-dataset file using a custom prompt.
Set the knowledge base, name, and API file ID; training type qa; fill the QA custom prompt.
Example 3: Place the new collection inside a specific folder.
Set the parent folder ID, then choose the knowledge base, name, API file ID, and training type.