Reference · Tools

LDAP

Interact with LDAP directory servers — search, compare, create, update, delete, and rename entries.

Action Development v1

The LDAP node talks directly to a directory server — Active Directory, OpenLDAP or any LDAP-compatible service — to search, compare, create, update, delete and rename entries. A typical build is provisioning a directory account when someone is added to the HR system, and disabling it when they leave.

Node type
Action
Parameters
17
Outputs
Output, Error
Credentials
LDAP

LDAP

Interact with LDAP directory servers

Overview

LDAP (Lightweight Directory Access Protocol) tool for interacting with directory services such as Active Directory, OpenLDAP, and other LDAP-compliant servers. Supports searching entries with filters, comparing attribute values, creating new entries, updating (add/replace/delete) attributes on existing entries, deleting entries, and renaming/moving entries by changing their distinguished name. Uses the ldapjs library for direct LDAP protocol communication over TCP with optional TLS/STARTTLS encryption.

Category: Development
Tool Name: ldap
Version: 1

Appearance: Icon: lucide-Network | Color: #6C3483

Node Type

Action — processes input items and produces output

Input / Output

DirectionPort(s)
InputInput
OutputOutput, Error

Credentials

This tool requires LDAP credentials. See the Credentials Guide for setup instructions.

Operations

OperationValueDescription
ComparecompareCompare an attribute value
CreatecreateCreate a new entry
DeletedeleteDelete an entry
RenamerenameRename the DN of an existing entry
SearchsearchSearch the LDAP directory
UpdateupdateUpdate attributes on an existing entry

Parameters

Compare (compare)

ParameterTypeRequiredDefaultDescription
DNstringYesThe distinguished name of the entry. Supports expressions like {{ $json.userDn }}.
Attribute IDstringYesThe attribute ID to compare. Find attribute names by performing a search operation on the entry first. Supports expressions.
ValuestringNoThe value to compare the attribute against. Supports expressions.

Create (create)

ParameterTypeRequiredDefaultDescription
DNstringYesThe distinguished name of the entry. Supports expressions like {{ $json.userDn }}.
Attributes (attributes)fixedCollectionNo{}Attributes to add to the new entry.
— Attribute IDstringYesThe attribute name (e.g. cn, sn, mail, objectClass).
— ValuestringNoThe value for this attribute.

Repeat the Attribute group to set several attributes. Adding the same Attribute ID more than once builds a multi-valued attribute.

Delete (delete)

ParameterTypeRequiredDefaultDescription
DNstringYesThe distinguished name of the entry. Supports expressions like {{ $json.userDn }}.

Rename (rename)

ParameterTypeRequiredDefaultDescription
DNstringYesThe distinguished name of the entry. Supports expressions like {{ $json.userDn }}.
New DNstringYesThe new distinguished name for the entry. Supports expressions.
ParameterTypeRequiredDefaultDescription
Base DNstringYesThe distinguished name of the subtree to search in. Supports expressions.
Search ForoptionsNocustomHow to construct the search filter. Use “Custom Filter” for raw LDAP filter syntax, or “Object Class Filter” to build a filter from object class + attribute + search text.
Options: custom (use a custom LDAP filter string), objectClass (search by object class and attribute)
Custom FilterstringNo(objectclass=*)Raw LDAP filter string. Escape special characters (* ( ) \) with a backslash. Example: (&(objectClass=person)(cn=john*)). Supports expressions. (shown when Search For is custom)
Object ClassstringNo(objectclass=*)LDAP object class filter. Use LDAP filter syntax, e.g. (objectclass=person), (objectclass=organizationalUnit). Type the object class name or use * for all. Supports expressions. (shown when Search For is objectClass)
AttributestringYesAttribute name to search by (e.g. cn, mail, sn, uid). Find attribute names by first running a search with a custom filter like (objectclass=*). Supports expressions. (shown when Search For is objectClass)
Search TextstringYesText to match against the attribute. Use * for wildcard matching. Supports expressions. (shown when Search For is objectClass)
Return AllbooleanNofalseWhether to return all results or only up to a given limit.
LimitnumberNo50Max number of results to return. (shown when Return All is false)
OptionscollectionNo{}Additional search options.
— AttributesstringNoComma-separated list of attribute names to return in results. Leave empty to return all attributes.
— Page SizenumberNo1000Maximum number of results to request at one time. Set to 0 to disable paging.
— ScopeoptionsNosubThe set of entries at or below the BaseDN that may be considered potential matches.
Options: base (the base object only), one (one level below the base), sub (the whole subtree)

In Object Class Filter mode, the Attribute and Search Text you supply are escaped before the filter is assembled, so a value containing *, (, ) or \ is matched literally rather than changing the filter’s meaning. Use Custom Filter when you want wildcards in the value itself.

Update (update)

ParameterTypeRequiredDefaultDescription
DNstringYesThe distinguished name of the entry. Supports expressions like {{ $json.userDn }}.
Update Attributes (attributes)fixedCollectionNo{}Attribute changes to apply. Use Add to add new values, Replace to change existing values, Remove to delete values.
— Add: Attribute IDstringYesThe attribute name to add.
— Add: ValuestringNoThe value to add.
— Replace: Attribute IDstringYesThe attribute name to replace.
— Replace: ValuestringNoThe new value for this attribute.
— Remove: Attribute IDstringYesThe attribute name to remove.
— Remove: ValuestringNoThe specific value to remove (leave empty to remove all values for this attribute).

Leaving Value empty on an Add or Replace group is rejected, because LDAP would read it as “delete every value of this attribute”. Use a Remove group when that is what you want.

All Operations

ParameterTypeRequiredDefaultDescription
Max ConcurrencynumberNo1Maximum number of items to process concurrently. LDAP operations share a single connection, so keep this low to avoid issues.

Output Data

Binary data is forwarded unchanged on every operation. Everything else depends on whether you searched or wrote:

OperationOutput items per input item
searchFans out — one item per matching entry. Each entry is merged onto the input item JSON, so upstream fields pass through.
compare, create, delete, rename, updateOne item whose JSON replaces the input item JSON with the result object below. Upstream fields do not pass through.

Search entries carry dn plus one property per returned attribute. A single-valued attribute is a string; a multi-valued attribute is an array. The Active Directory binary attributes objectGUID and objectSid are converted to hex strings so they survive JSON. Two flags may appear:

  • _searchResultCount: 0 — the search matched nothing, and one item is emitted anyway so the branch is not silently empty.
  • _truncated: true — the directory server stopped early because of its own size limit, so the results are incomplete.

Write results carry:

OperationFields
comparedn, attribute, result (true when the value matches)
createdn, result: "success"
deletedn, result: "success"
renamedn (the new DN), result: "success"
updatedn, result: "success", changes[] — one entry per modification, each { operation, modification: { type, values } }

The item’s own dn field wins. For every operation except Search, if the incoming item JSON already has a dn property, that value is used as the target DN and the DN parameter is ignored. This makes it easy to chain a Search into a Delete or Update without wiring the DN through by hand — but it also means an unrelated upstream dn field will silently redirect the operation.

Reference the result downstream by expression, e.g. {{ $json.dn }} or {{ $json.mail }}.

Usage Examples

  • Search Active Directory for all users in a department
  • Create a new LDAP entry for a user
  • Update user attributes in LDAP directory
  • Delete an LDAP directory entry
  • Compare an attribute value for an entry
  • Rename/move an LDAP entry to a different OU

Example Configuration

Search a subtree with a raw LDAP filter, returning only selected attributes:

{
  "type": "ldap",
  "parameters": {
    "operation": "search",
    "baseDN": "ou=users,dc=example,dc=com",
    "searchFor": "custom",
    "customFilter": "(&(objectClass=person)(department=Engineering))",
    "returnAll": false,
    "limit": 100,
    "options": {
      "attributes": "cn, mail, department",
      "scope": "sub",
      "pageSize": 1000
    }
  }
}

Search by object class and attribute instead of writing a filter:

{
  "type": "ldap",
  "parameters": {
    "operation": "search",
    "baseDN": "ou=users,dc=example,dc=com",
    "searchFor": "objectClass",
    "objectClassFilter": "(objectclass=person)",
    "attribute": "mail",
    "searchText": "{{ $json.email }}",
    "returnAll": true
  }
}

Create a new entry:

{
  "type": "ldap",
  "parameters": {
    "operation": "create",
    "dn": "cn={{ $json.username }},ou=users,dc=example,dc=com",
    "attributes": {
      "attribute": [
        { "id": "objectClass", "value": "inetOrgPerson" },
        { "id": "cn", "value": "{{ $json.username }}" },
        { "id": "sn", "value": "{{ $json.lastName }}" },
        { "id": "mail", "value": "{{ $json.email }}" }
      ]
    }
  }
}

Replace one attribute and remove another:

{
  "type": "ldap",
  "parameters": {
    "operation": "update",
    "dn": "{{ $json.dn }}",
    "attributes": {
      "replace": [
        { "id": "department", "value": "{{ $json.newDepartment }}" }
      ],
      "delete": [
        { "id": "telephoneNumber", "value": "" }
      ]
    }
  }
}

Check whether an attribute holds a given value:

{
  "type": "ldap",
  "parameters": {
    "operation": "compare",
    "dn": "{{ $json.dn }}",
    "id": "mail",
    "value": "{{ $json.email }}"
  }
}

Move an entry to a different OU:

{
  "type": "ldap",
  "parameters": {
    "operation": "rename",
    "dn": "{{ $json.dn }}",
    "targetDn": "cn={{ $json.cn }},ou=archive,dc=example,dc=com"
  }
}

Error Handling

ModeBehavior
stopHalts workflow on first error
continueSkips failed items, passes successful ones through
errorPortRoutes failed items to Error output port

Tips

Search, create, update, delete, compare, and rename entries in LDAP directory servers like Active Directory or OpenLDAP.

Frequently asked questions

Which directory servers work with it?

Any LDAP-compatible server, including Active Directory and OpenLDAP, since it speaks the protocol rather than a vendor-specific API.

What can it do besides search?

Create, update, delete, rename and compare entries, which covers the full lifecycle of a directory object rather than just reading it.

What is the compare operation for?

Checking whether an attribute holds a particular value without retrieving the whole entry — useful for membership or flag checks in a conditional branch.

Which credential does it need?

An LDAP credential holding the server details and bind identity used for every operation.

Build with the LDAP node

Drop it into a workflow, wire it to an agent, or call it on a schedule. You'll need LDAP credentials first.

Open BusyBot

Last updated . Spotted something wrong? Tell us.