Update Documents
erpnext.update_documents
ActionCRM & salesconnection required
Calls the ERPNext API with the connection's credentials.
Update many documents in one request, reporting each failure separately instead of failing the whole batch.
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
2 fields, 1 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 |
documents The updates, each keyed by docname, e.g. [{"docname": "CUST-0001", "customer_group": "Commercial"}]. Each may name its own doctype to override the one above. | array | Yes | — | ≥ 1 characters; array of object | [{"customer_group":"Commercial","docname":"CUST-0001"}] |
Example configuration
Every value below is the contract’s own example or default — nothing invented.
{
"doctype": "Customer",
"documents": [
{
"customer_group": "Commercial",
"docname": "CUST-0001"
}
]
}Output
One shape.
result
| Field | Type | Example |
|---|---|---|
doctype The default DocType the batch was updated as. | string | — |
requested How many updates were sent. | number | — |
updated_count How many documents ERPNext saved. | number | — |
failed_count How many documents ERPNext could not save. | number | — |
failed_docs One entry per failure, each with the document sent and the traceback ERPNext raised. | array | — |
partial True when some documents saved and some did not — branch on this rather than on the step succeeding. | boolean | — |
{
"doctype": "",
"failed_count": 0,
"failed_docs": [],
"partial": false,
"requested": 0,
"updated_count": 0
}See Update Documents 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.