Reference · Tools
ERPNext
Perform CRUD operations on ERPNext/Frappe Framework documents (DocTypes)
The ERPNext node lets you perform create, read, update, delete, and list operations on any DocType in your ERPNext or Frappe Framework instance. It works with standard DocTypes like Customers, Sales Invoices, Items, and Purchase Orders, as well as any custom DocTypes you've defined. A typical use case is automatically creating a Sales Invoice in ERPNext whenever a new order arrives from an external platform.
- Node type
- Action
- Parameters
- 16
- Outputs
- Output, Error
- Credentials
- ERPNext API
ERPNext
Perform CRUD operations on ERPNext documents
Overview
ERPNext is a free and open-source enterprise resource planning (ERP) platform built on the Frappe Framework. This tool provides a generic CRUD interface for any DocType in an ERPNext instance, including Customers, Sales Invoices, Items, Purchase Orders, and any custom DocTypes. It supports creating, reading, updating, deleting, and listing documents with optional field selection and filtering. The API uses token-based authentication with an API key and secret pair.
Category: Data & Storage
Tool Name: erpnext
Version: 1
Appearance: Icon: lucide-Building | Color: #0089FF
Node Type
Action — processes input items and produces output
Input / Output
| Direction | Port(s) |
|---|---|
| Input | Input |
| Output | Output, Error |
Credentials
This tool requires ERPNext API credentials. See the Credentials Guide for setup instructions.
Resources
| Resource | Value |
|---|---|
| Document | document |
Operations
| Operation | Value | Description |
|---|---|---|
| Create | create | Create a document |
| Delete | delete | Delete a document |
| Get | get | Retrieve a document |
| Get Many | getAll | Retrieve many documents |
| Update | update | Update a document |
Parameters
Document: Create
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| DocType | string | Yes | — | The DocType of the document to create (e.g., “Customer”, “Sales Invoice”, “Item”). Find available DocTypes at your ERPNext instance under Setup > DocType. |
| Properties | fixedCollection | Yes | {} | Field-value pairs for the document to create. At least one property is required. |
| — Field | string | No | — | Field name (e.g., “customer_name”, “item_code”). Find available fields at your ERPNext DocType definition. |
| — Value | string | No | — | The value to store in that field. |
Document: Delete
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| DocType | string | Yes | — | The DocType of the document to delete (e.g., “Customer”, “Sales Invoice”, “Item”). Find available DocTypes at your ERPNext instance under Setup > DocType. |
| Document Name | string | Yes | — | The name (unique ID) of the document to delete. |
Document: Get
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| DocType | string | Yes | — | The DocType of the document to retrieve (e.g., “Customer”, “Sales Invoice”, “Item”). Find available DocTypes at your ERPNext instance under Setup > DocType. |
| Document Name | string | Yes | — | The name (unique ID) of the document to retrieve. |
Document: Get Many
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| DocType | string | Yes | — | The DocType whose documents to retrieve (e.g., “Customer”, “Sales Invoice”, “Item”). Find available DocTypes at your ERPNext instance under Setup > DocType. |
| Return All | boolean | No | false | Whether to return all results or only up to a given limit. |
| Limit | number | No | 10 | Max number of results to return. (shown when Return All is false) |
| Options | collection | No | {} | Field selection and filtering for the query. |
| — Fields | string | No | — | Comma-separated list of fields to return. Use ”*” for all fields. Leave empty for default fields (usually just “name”). Example: “name,customer_name,status”. |
| — Filters | fixedCollection | No | {} | Filter conditions for the query. |
| — — Field | string | No | — | The field name to filter on (e.g., “status”, “customer_name”). Find available fields at your ERPNext DocType definition. |
| — — Operator | options | No | is | How the field is compared to the value. |
Options: equalsGreater (EQUALS, or GREATER — >=), equalsLess (EQUALS, or LESS — <=), is (=), greater (>), less (<), isNot (!=) | ||||
| — — Value | string | No | — | Value of the operator condition. |
Document: Update
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| DocType | string | Yes | — | The DocType of the document to update (e.g., “Customer”, “Sales Invoice”, “Item”). Find available DocTypes at your ERPNext instance under Setup > DocType. |
| Document Name | string | Yes | — | The name (unique ID) of the document to update. |
| Properties | fixedCollection | No | {} | Field-value pairs to update on the document. At least one property is required. |
| — Field | string | No | — | Field name to update (e.g., “status”, “customer_name”). Find available fields at your ERPNext DocType definition. |
| — Value | string | No | — | The value to store in that field. |
All Operations
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| Max Concurrency | number | No | 10 | Maximum number of items to process concurrently. Accepts 1–100. |
Output Data
The ERPNext document is merged onto the input item’s JSON, so the properties you started with remain available alongside the DocType’s fields. Binary data on the input item is forwarded.
| Operation | Output |
|---|---|
create | One item per input item, carrying the created document — including the name ERPNext assigned, which is the ID every other operation takes. |
get | One item per input item, carrying the document’s fields. |
update | One item per input item, carrying the document as it stands after the update. |
delete | One item per input item, carrying ERPNext’s delete response. |
getAll | Fans out — one output item per document returned. A query that matches nothing emits one item, which is the input item passed through unchanged. |
By default a listing returns only the name of each document — set Fields to *, or to the specific columns you need, to get more back.
Reference fields downstream by their ERPNext field name, e.g. {{ $json.name }} or {{ $json.customer_name }}.
Usage Examples
- Create a new Customer in ERPNext
- Retrieve all Sales Invoices with status Active
- Update an Item record by name
- Delete a Purchase Order document
- List all DocTypes with field filtering
Example Configuration
Create a Customer:
{
"type": "erpnext",
"parameters": {
"resource": "document",
"operation": "create",
"docType": "Customer",
"properties": {
"customProperty": [
{ "field": "customer_name", "value": "{{ $json.company }}" },
{ "field": "customer_type", "value": "Company" },
{ "field": "customer_group", "value": "Commercial" }
]
}
}
}
Fetch one document by its name:
{
"type": "erpnext",
"parameters": {
"resource": "document",
"operation": "get",
"docType": "Sales Invoice",
"documentName": "{{ $json.invoiceId }}"
}
}
List Sales Invoices over a threshold, returning specific fields:
{
"type": "erpnext",
"parameters": {
"resource": "document",
"operation": "getAll",
"docType": "Sales Invoice",
"returnAll": false,
"limit": 50,
"options": {
"fields": "name,customer,status,grand_total",
"filters": {
"customProperty": [
{ "field": "status", "operator": "is", "value": "Overdue" },
{ "field": "grand_total", "operator": "greater", "value": "1000" }
]
}
}
}
}
Page through every Item in the instance:
{
"type": "erpnext",
"parameters": {
"resource": "document",
"operation": "getAll",
"docType": "Item",
"returnAll": true,
"options": {
"fields": "*"
}
}
}
Update a document’s status:
{
"type": "erpnext",
"parameters": {
"resource": "document",
"operation": "update",
"docType": "Item",
"documentName": "{{ $json.name }}",
"properties": {
"customProperty": [
{ "field": "disabled", "value": "1" }
]
}
}
}
Delete a document:
{
"type": "erpnext",
"parameters": {
"resource": "document",
"operation": "delete",
"docType": "Purchase Order",
"documentName": "{{ $json.name }}"
}
}
Error Handling
| Mode | Behavior |
|---|---|
| stop | Halts workflow on first error |
| continue | Skips failed items, passes successful ones through |
| errorPort | Routes failed items to Error output port |
Tips
Perform CRUD operations on ERPNext/Frappe Framework documents such as Customers, Invoices, Items, and any other DocType.
Frequently asked questions
What credentials do I need to connect this node to my ERPNext instance?
The node uses ERPNext API credentials, specifically a token-based API key and secret pair (credential type: erpNextApi). You generate these from your ERPNext user profile under API Access. Both the key and secret are required — neither alone is sufficient to authenticate.
Does this node only work with built-in ERPNext DocTypes, or can I use my own custom ones?
It works with any DocType your ERPNext instance exposes via its REST API, including custom DocTypes you've created through the Frappe Framework. As long as the DocType exists on your instance and your API user has the appropriate permissions, you can target it with this node.
What happens when an API call fails — does the workflow stop?
The node has two separate outputs: Output and Error. A failed operation routes to the Error output rather than halting the workflow, which means you can wire up error-handling logic — such as logging the failure or sending an alert — without the entire automation stopping.
Can I fetch only specific fields from a document rather than the entire record?
Yes. The node supports optional field selection when reading or listing documents, so you can limit the response to only the fields you actually need. This is useful for keeping payloads small when working with DocTypes that have many fields, such as Sales Invoices or Employee records.
Can I filter results when listing documents?
Yes. The List operation supports optional filters, letting you narrow results by field values — for example, listing only Customers in a specific territory or Invoices with a particular status. Filters follow the Frappe Framework's standard filter format, so familiarity with that syntax helps when building complex queries.
Build with the ERPNext node
Drop it into a workflow, wire it to an agent, or call it on a schedule. You'll need ERPNext API credentials first.
Open BusyBotLast updated . Spotted something wrong? Tell us.