@catalogicus-international/n8n-nodes-moy-sklad
v0.3.4
Published
n8n community node for the MoySklad JSON API
Readme
@catalogicus-international/n8n-nodes-moy-sklad
Community node for the MoySklad JSON API.
Features
- Bearer token credentials for the MoySklad API.
- Common entity operations: create, delete, get, get many, update.
- Supported entities: assortment, counterparty, customer order, demand, invoice out, organization, processing plan, production task, product, sales channel, service, store, supply.
- Custom API Call resource for endpoints that are not exposed as first-class operations yet.
- Separate
MoySkladflow node with main input and output connectors. MoySklad Triggernode for MoySklad webhook events.- Separate
MoySklad Toolnode for AI Agent tool connections.
Development
npm install
npm run build
npm run lintFor local n8n development:
npm run devCredentials
Create an API token in MoySklad and add it to the MoySklad API credential. The default base URL is:
https://api.moysklad.ru/api/remap/1.2Usage
The package provides three nodes:
MoySkladis a regular workflow node with main input and output connectors.MoySklad Triggerstarts workflows from MoySklad webhook events.MoySklad Toolconnects to the Tool input of an AI Agent.
In the regular MoySklad node, use Entity for common operations. For requests that need a MoySklad endpoint not listed in the node yet, use Custom API Call and pass a path relative to the base URL, for example:
/entity/product
/entity/customerorder
/entity/counterparty
/entity/productiontaskProduction task
Select Entity → Production Task to create, get, list, update, or delete production tasks through /entity/productiontask.
The Fields body mode supports:
- Document fields such as name, code, description, document/planned dates, and production start.
- Applicable, awaiting, reserve, and shared flags.
- Organization, materials store, products store, owner, group, and state references. Enter either a MoySklad UUID or a full API href.
- Attributes, production rows, and products as JSON arrays in the MoySklad API format.
Organization, Materials Store, and Products Store are required by MoySklad when creating a production task. Adding Production Start starts production.
When updating a production task, Production Rows and Products are complete replacement collections: rows omitted from a supplied array are removed. Leave these fields unselected when they should not change. Use Raw JSON for fields that are not exposed in Fields mode.
Dedicated nested resources are available through Custom API Call, for example:
/entity/productiontask/<task-id>/productionrows
/entity/productiontask/<task-id>/productsWebhook trigger
Use MoySklad Trigger as the first node in a workflow to subscribe to MoySklad entity events. Select the entity type and one or more actions: create, update, or delete.
When the workflow is activated, the node creates the matching MoySklad webhook subscriptions through the JSON API. When the workflow is deactivated, it removes those subscriptions. The n8n webhook URL must be reachable from MoySklad, so local development usually requires a public tunnel or an externally accessible n8n instance.
By default, the trigger outputs the raw MoySklad event and fetches the changed entity when the event includes a meta.href. Disable Fetch Entity to output only the webhook event payload.
AI Agent tool
Connect MoySklad Tool to an AI Agent. It exposes one JSON argument named request, so the agent can choose the entity, operation, query parameters, and request body according to its system prompt.
Example contract for the agent prompt:
Call the MoySklad tool with one JSON object named request.
For entity operations:
{
"resource": "entity",
"entity": "assortment | counterparty | customerorder | demand | invoiceout | organization | processingplan | productiontask | product | saleschannel | service | store | supply",
"operation": "create | delete | get | getAll | update",
"id": "required for get, update, and delete",
"query": {},
"body": {},
"returnAll": false,
"limit": 50
}
Use body only for create and update. Use query for get and getAll.
limit must be an integer from 1 to 1000. returnAll applies only to getAll.
For production tasks, use `"entity": "productiontask"`. Create and update bodies supplied by the agent must already use the MoySklad API shape, including `meta` objects for references.
For an endpoint not covered by entity operations:
{
"resource": "custom",
"method": "GET | POST | PUT | PATCH | DELETE",
"path": "/relative/api/path",
"query": {},
"body": {}
}Available Scripts
| Script | Description |
| --------------------- | --------------------------------------------------------------------------- |
| npm run dev | Start n8n with your node and watch for changes (runs n8n-node dev) |
| npm run build | Compile TypeScript to JavaScript for production (runs n8n-node build) |
| npm run build:watch | Build in watch mode (auto-rebuild on changes) |
| npm run lint | Check your code for errors and style issues (runs n8n-node lint) |
| npm run lint:fix | Automatically fix linting issues when possible (runs n8n-node lint --fix) |
| npm run release | Create a new release (runs n8n-node release) |
