Overview
This node integrates with the Chinese version of the ERPNext API, enabling users to manage ERPNext resources directly within n8n workflows. Specifically, for the "Doctype更删改" resource and the "创建" (Create) operation, it allows creating new documents of a specified document type in ERPNext. This is useful for automating data entry, syncing external systems with ERPNext, or programmatically generating records based on workflow logic.
Practical examples include:
- Automatically creating customer records when a new lead is captured.
- Generating sales orders from form submissions.
- Adding inventory items based on supplier updates.
Properties
| Name | Meaning |
|---|---|
| 文档类型 Name or ID | The document type to create. Choose from a searchable list of available document types or specify an ID using an expression. |
| 属性 | A collection of properties representing fields and their values to set on the new document. Each property includes: |
| - 字段名称或ID Name or ID | The field name or ID within the selected document type. Selectable from a list that depends on the chosen document type or specified via expression. |
| - 值 Value | The value to assign to the corresponding field in the new document. |
Output
The node outputs JSON data representing the newly created document in ERPNext. This typically includes all fields of the created record as returned by the ERPNext API, such as its unique identifier, timestamps, and any computed fields.
If the node supports binary data output (not indicated here), it would represent file attachments or similar content related to the created document.
Dependencies
- Requires connection to an ERPNext instance with the Chinese localization API enabled.
- Needs an API authentication credential configured in n8n to authorize requests.
- Relies on dynamic loading methods to fetch available document types and fields (
getDocTypes,getDocFields), which require proper API access.
Troubleshooting
Common issues:
- Incorrect or missing API credentials will cause authentication failures.
- Specifying a document type or field that does not exist or is inaccessible will result in errors.
- Providing invalid field values (wrong data types or formats) may cause the creation to fail.
Error messages:
"Resource Doctype更删改 not found or not implemented": Indicates the resource name is incorrect or not supported by the node.- Validation errors from ERPNext API about required fields or data constraints.
Resolutions:
- Verify API credentials and permissions.
- Use the node’s dropdowns and search features to select valid document types and fields.
- Ensure field values conform to expected formats and types.
Links and References
- ERPNext Official Documentation
- n8n Expressions Documentation
- ERPNext API Reference (general REST API concepts applicable)