FastGPT JSON Config Skill
Treat this skill as a specification plus test suite: generate by copying templates, then prove the file passes deterministic checks.
Required Resources
Load these first for every generation or repair task:
references/generation-hard-rules.mdreferences/official-default-node-templates.jsonreferences/official-node-contract-summary.mdreferences/runtime-node-templates.mdreferences/node-field-contracts.mdreferences/acceptance-spec.mdscripts/validate_fastgpt_json.py
Load conditional references only when the requirement needs them:
references/required-input-rules.mdreferences/ifelse-rules.mdreferences/dataset-rules.mdreferences/classify-rules.mdreferences/node-selection-rules.mdreferences/workflow-generation-playbook.mdreferences/json-config-runtime-reference.mdreferences/json-import-feature-guide.mdonly for import UI/background behavior; do not copy node templates from itreferences/json-config-specification.mdonly for historical/background context; do not copy node templates or IO keys from itreferences/json-config-troubleshooting.mdonly when repairing a known broken file; do not copy node templates from itreferences/protocol-v1.md
Execution Protocol
Follow this order exactly.
- Decompose the request into stages.
- Create a node inventory.
- Copy node shapes from
official-default-node-templates.json; useruntime-node-templates.mdonly as an override and usage guide. - Fill
inputs[].valueafter node IDs are fixed. - Generate
edgeslast. - Save JSON with UTF-8.
- Run
python scripts/validate_fastgpt_json.py <generated-file>. - Fix any
ERROR:and rerun untilVALIDATION_OK. - Apply readable layout before validation:
- connected columns must be spaced at least
1500on x - branch or sibling nodes must be spaced at least
1000on y - prefer
0, 1500, 3000, 4500...for x positions - do not stack connected nodes at the same position
- connected columns must be spaced at least
Node Inventory
Before writing JSON, record:
nodeIdflowNodeType- purpose
- position
- required input keys
- output keys
- upstream data dependencies
- visual predecessor and visual successor
Include exactly one workflowStart and one userGuide.
Copy Rules
- Keep runtime configuration in
node.inputs, neverprops. - Use
references/official-default-node-templates.jsonas the source of truth for single-node default inputs, outputs, render types, value types, labels, hidden fields, and dynamic system fields. runtime-node-templates.mdis not a competing template source. It only explains how to copy official defaults and which scenario values may be filled.- Do not invent inputs, outputs, handles, or variable syntax.
- Generate clean UTF-8 Chinese user-facing text.
- Required files flow through
workflowStart.userFilesandreadFiles.system_text. - Normal input references use
["nodeId", "outputKey"]. answerNode.text.valuemust be a string. Variable references inside it must use{{$nodeId.outputKey$}}; never use array references such as["nodeId", "outputKey"]foranswerNode.text.textEditor.system_textareaInputuses{{$nodeId.outputKey$}}when embedding upstream variables in text.- Every runtime reference must point to a node that is upstream of the consuming node in the visual edge graph. A direct edge is not required when the referenced node and the consuming node are already on the same upstream chain.
- Do not leave business nodes isolated. Every non-
workflowStartand non-userGuidenode must be reachable fromworkflowStartthrough edges, and every final path must reach ananswerNode.
Edge Rules
- Edges are visual canvas connections, not data bindings.
- Normal edges must use:
sourceHandle: "{sourceNodeId}-source-right"targetHandle: "{targetNodeId}-target-left"
- Never use business keys such as
system_text,answerText,userFiles,userChatInput,fileUrlList,system_textareaInput, ortextas edge handles. - Branch nodes use their documented branch handles.
- Edges express the readable execution chain. Do not add a separate direct edge for every referenced input when the referenced node is already upstream of the consuming node through the chain.
- If node B references output from node A and A is not already upstream of B, add or reorder visual edges so A becomes upstream of B.
- Do not create unreferenced business nodes just to satisfy a design idea.
Hard Requirements
- Official default
workflowStarthas inputuserChatInputand outputuserChatInput; adduserFilesonly when the workflow needs chat file upload. - Every
chatNodeincludesmodel,isResponseAnswerText,systemPrompt,history,quoteQA,fileUrlList, anduserChatInput. chatNode.model.renderTypeListincludessettingLLMModel.- If a
chatNodeeventually outputs through ananswerNode, setisResponseAnswerText.value = false. contentExtractoutputs onlysuccess,fields, andsystem_error_text.textEditorputs deterministic template text insystem_textareaInput.value.answerNodeis final reply only and uses input keytext.answerNode.text.valuemust never be["nodeId", "outputKey"]; use"{{$nodeId.outputKey$}}"instead.ifElseNode.ifElseList.value[]usesconditionpluslist.httpRequest468.system_httpReqUrl.valueis never empty.userGuidefollows the official default system config inputs (welcomeText,variables,questionGuide,tts,whisper,scheduleTrigger) and has no business outputs.- Generated JSON must not contain mojibake markers.
- Connected nodes must differ by at least
1500on x. - Branch/sibling nodes must differ by at least
1000on y. - Node layout must remain readable; avoid stacked or overlapping positions.
- Runtime references and edges must agree: every
["nodeId", "outputKey"]and every{{$nodeId.outputKey$}}used inside a node must reference a node that is reachable upstream through the visual edge graph. Do not require direct source-to-target edges for all references. - Every business node must be on the workflow path: reachable from
workflowStartand able to reach ananswerNode, unless it isuserGuide.
Validation
- Save the JSON to disk first unless the user explicitly requests chat-only output.
- Run the bundled validator from the skill directory or by absolute path.
- Any
ERROR:is blocking. - If the validator cannot run, report
未验证:未能运行校验脚本. - Do not call JSON import-ready unless validation passes.
Final Response
Return a concise Chinese report:
需求确认生成结果or修复结果验证报告文件路径
Do not paste large JSON unless the user asks.
Protocol Export
When the user asks to "export with skill protocol", output a fenced block using fastgpt-json-skill-protocol/v1 from references/protocol-v1.md.


