Rename Document
erpnext.rename_document
ActionCRM & salesconnection required
Calls the ERPNext API with the connection's credentials.
Rename a document, optionally merging it into an existing one of the same DocType.
Connection
- Required
- Yes — the node will not save without one
- Auth type
- API key
- Providers
- ERPNext
- Secret shape
- {"api_key": "…", "api_secret": "…"}
- Config it needs
- base_url, doctype
- Resolved by
- config.connection_id, else node.connection_id
Configuration
4 fields, 2 required. A dotted path is a nested object and name[] an array of objects — the editor renders the same tree.
| Field | Type | Required | Default | Constraints | Example |
|---|---|---|---|---|---|
doctype The DocType to act on, spelled as ERPNext spells it (e.g. 'Sales Order'). Overrides the default DocType on the connection. | string | No | — | — | Customer |
old_name The document's current name. | string | Yes | — | — | CUST-0001 |
new_name The name it should have afterwards. | string | Yes | — | — | CUST-ACME |
merge Merge into new_name when a document by that name already exists, instead of failing. Links move to the surviving document. | boolean | No | false | — | — |
Example configuration
Every value below is the contract’s own example or default — nothing invented.
{
"doctype": "Customer",
"merge": false,
"new_name": "CUST-ACME",
"old_name": "CUST-0001"
}Output
One shape.
result
| Field | Type | Example |
|---|---|---|
doctype The DocType that was renamed within. | string | — |
old_name The name the document had before. | string | — |
name The name the document has now. | string | — |
merged True when the rename was run as a merge. | boolean | — |
{
"doctype": "",
"merged": false,
"name": "",
"old_name": ""
}See Rename Document run in a workflow.
In a technical demo we add the ERPNext connection, drop the node on the canvas and let Workflow Health pre-flight it before the first real run.