code.setCode
Edit code content in Circuitry's visual workflow platform to modify functions or logic while preserving the node structure, with optional diff review before applying changes.
Instructions
Update code content in a code node. Use showDiff: true to show inline diff UI for user to review/accept changes. If node is EServer-sourced, will sync to source file.
CRITICAL: Use this for "remove/add/change the X function" requests - EDIT the code content, don't delete the node!
"remove the power function" → Get code with code.getCode, then update with code.setCode (function removed)
"delete the node" → Use nodes.delete instead (removes entire node)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nodeId | Yes | Code node ID | |
| code | Yes | Source code to set | |
| options | No | Options: { showDiff?: boolean (show diff UI), targetName?: string (display name), source?: string } |