Swap an operator's type in place
swap_operatorChange an operator's type while preserving its name, position, wires, and matching parameters. Reports per-wire and per-param failures without aborting.
Instructions
Change an operator's TYPE while preserving its name, position, incoming + outgoing wires, and any parameters that exist on the new type. Snapshots wires + params, deletes the old node, creates a new node of new_type at the same parent/name/x/y, re-applies matching params (others go into dropped_parameters), and rewires connectors. Fail-forward: per-wire / per-param failures are reported as failed_inputs[] / failed_outputs[] / dropped_parameters[] rather than aborting. Returns {old_type, new_path, preserved_parameters, dropped_parameters, reconnected_inputs, reconnected_outputs, failed_inputs, failed_outputs, warnings}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| node_path | Yes | Path of the node to swap (e.g. '/project1/noise1'). | |
| new_type | Yes | New operator type, e.g. 'rampTOP', 'constantCHOP'. | |
| preserve_parameters | No | Re-apply parameters that exist (by name) on the new type. |