n8n Kommo Nodes

0.0.16 · active · verified Sun Apr 19

n8n-nodes-kommo is a community-developed n8n node package designed to integrate n8n workflows with the Kommo CRM API. It provides a comprehensive set of operations to automate interactions with Kommo, including managing companies, contacts, deals, tasks, notes, and lists directly within n8n workflows. Currently at version 0.0.16, this package is in its early development stages, typical for community nodes, which implies a potentially rapid iteration cycle. While an explicit release cadence is not stated, users should anticipate frequent updates. It differentiates itself by offering a direct, pre-built bridge to Kommo's functionalities, enabling n8n users to automate CRM processes without writing custom code for API interactions. This node is installed directly through n8n's community nodes interface, rather than as a traditional npm dependency in a separate project.

Common errors

Warnings

Install

Imports

Quickstart

This TypeScript code provides a conceptual example of how an n8n node for Kommo (like n8n-nodes-kommo) is structured. It demonstrates the definition of a simple node class, its metadata (description), credentials handling, and a 'Get Account Info' operation using a mocked API client. This is for developers extending n8n, as end-users interact with the node via the n8n visual editor.

import { INodeType, INodeTypeDescription, IExecuteFunctions } from 'n8n-workflow';

// This quickstart demonstrates how an n8n node *could be defined* in TypeScript,
// mimicking the functionality of n8n-nodes-kommo for 'Get Account Info'.
// Users of n8n-nodes-kommo typically install and configure it via the n8n UI,
// rather than importing it programmatically into their own code.

// Dummy Kommo API client (in a real node, this would handle actual API calls)
class MockKommoApiClient {
  private accessToken: string;

  constructor(credentials: any) {
    // In a real scenario, credentials would be used to obtain an access token.
    this.accessToken = credentials?.accessToken || 'mock_access_token';
    console.log(`Initialized MockKommoApiClient with token: ${this.accessToken}`);
  }

  async getAccountInfo() {
    console.log('Mock: Fetching Kommo account info...');
    // Simulate API response structure for Kommo account info
    return {
      account_id: '1234567',
      domain: 'mock-subdomain.kommo.com',
      currency: 'USD',
      timezone: 'America/New_York',
      _system: 'Kommo-CRM-Mock'
    };
  }
}

export class ExampleKommoNode implements INodeType {
  description: INodeTypeDescription = {
    displayName: 'Example Kommo Node',
    name: 'exampleKommo',
    icon: 'file:kommo.svg', // Placeholder icon
    group: ['transform'],
    version: 1,
    description: 'An example n8n node to interact with Kommo CRM (mocked)',
    defaults: {
      name: 'Example Kommo',
    },
    credentials: [
      {
        name: 'kommoApi',
        required: true,
      },
    ],
    inputs: ['main'],
    outputs: ['main'],
    properties: [
      {
        displayName: 'Operation',
        name: 'operation',
        type: 'options',
        options: [
          {
            name: 'Get Account Info',
            value: 'getAccountInfo',
            action: 'Retrieve Kommo account details',
          },
        ],
        default: 'getAccountInfo',
        noDataExpression: true,
        description: 'The operation to perform on Kommo.',
      },
    ],
  };

  async execute(this: IExecuteFunctions) {
    const items = this.getInputData();
    const returnData = [];

    const credentials = await this.getCredentials('kommoApi');
    const kommoClient = new MockKommoApiClient(credentials);

    for (let i = 0; i < items.length; i++) {
      const operation = this.getNodeParameter('operation', i) as string;

      if (operation === 'getAccountInfo') {
        const accountInfo = await kommoClient.getAccountInfo();
        returnData.push({ json: accountInfo });
      } else {
        throw new Error(`Unsupported operation: ${operation}`);
      }
    }
    return [returnData];
  }
}

view raw JSON →