Create Document
erpnext.create_document
ActionCRM & salesconnection required
Calls the ERPNext API with the connection's credentials.
Insert one document of a DocType and return it as ERPNext stored it.
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 |
document The new document's fields as an object, e.g. {"customer_name": "Acme Ltd", "customer_type": "Company"}. Child tables are nested arrays. | object | Yes | — | ≥ 1 characters | {"customer_name":"Acme Ltd","customer_type":"Company"} |
Example configuration
Every value below is the contract’s own example or default — nothing invented.
{
"doctype": "Customer",
"document": {
"customer_name": "Acme Ltd",
"customer_type": "Company"
}
}Output
One shape.
result
| Field | Type | Example |
|---|---|---|
doctype The DocType that was acted on. | string | — |
name The document's name in ERPNext. | string | — |
document The whole document as ERPNext stored it, child tables included. | object | — |
{
"doctype": "",
"document": {},
"name": ""
}See Create 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.