Attach File
erpnext.attach_file
ActionCRM & salesconnection required
Calls the ERPNext API with the connection's credentials.
Attach base64-encoded file content to a document and return the File record ERPNext created.
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
7 fields, 3 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 |
name The document's name — its primary key in ERPNext (e.g. 'ACC-SINV-2025-00001'). | string | Yes | — | — | CUST-0001 |
filename The name the attachment should have in ERPNext, extension included. | string | Yes | — | — | invoice.pdf |
content_base64 The file's bytes, base64-encoded — the same envelope the binary nodes emit. | string | Yes | — | — | — |
folder The File folder to file it under. ERPNext uses Home/Attachments when empty. | string | No | — | — | — |
is_private Keep the file behind ERPNext's login. Turn off only for files that may be fetched by anyone with the URL. | boolean | No | true | — | — |
docfield An Attach field on the document to point at the new file as well. | string | No | — | — | — |
Example configuration
Every value below is the contract’s own example or default — nothing invented.
{
"doctype": "Customer",
"filename": "invoice.pdf",
"is_private": true,
"name": "CUST-0001"
}Output
One shape.
result
| Field | Type | Example |
|---|---|---|
doctype The DocType the file was attached to. | string | — |
name The document the file was attached to. | string | — |
file_name The attachment's name in ERPNext. | string | — |
file_url The path ERPNext serves the file from. | string | — |
file The whole File record ERPNext created. | object | — |
{
"doctype": "",
"file": {},
"file_name": "",
"file_url": "",
"name": ""
}See Attach File 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.