TwentyDEV icon

TwentyDEV

Consume the Twenty API

Actions252

Overview

This node operation, Find Many Companies, allows users to retrieve multiple company records from an external service via its API. It is useful for scenarios where you need to list companies with specific filtering, sorting, and pagination options. For example, you might want to fetch all companies that match certain criteria (e.g., industry type or location), sort them by creation date, and limit the number of results returned per request.

Practical use cases include:

  • Building dashboards that display lists of companies.
  • Synchronizing company data from the external system into your own database.
  • Filtering companies based on dynamic criteria for reporting or automation workflows.

Properties

Name Meaning
Order By Sorts the returned company objects. The value should be a comma-separated list of field names optionally followed by a direction specifier. Available directions are: AscNullsFirst, AscNullsLast, DescNullsFirst, DescNullsLast. If no direction is specified, the default is AscNullsFirst. Example: name,createdAtDescNullsLast. Default is id.
Filter Filters the returned company objects using field comparators. The filter string supports expressions like field[comparator]:value separated by commas. Comparators include eq, neq, in, containsAny, is, gt, gte, lt, lte, startsWith, like, ilike. Logical conjunctions (and, or, not) can be used for complex filters. Supports filtering null and boolean values. Default excludes a zero UUID id.
Limit Limits the number of company objects returned in the response. Default is 60.
Depth Controls how many levels of nested related objects are included in the response: 0 returns only the primary company object; 1 includes directly related objects; 2 includes related objects of those related objects as well. Default is 1.
Starting After Returns company objects starting after a specific cursor value. Useful for pagination. Cursor values can be found in the response's pageInfo section under startCursor or endCursor.
Ending Before Returns company objects ending before a specific cursor value. Also used for pagination. Cursor values are found in pageInfo in the response.

Output

The node outputs JSON data containing an array of company objects matching the query parameters. Each company object includes fields as defined by the API schema, potentially including nested related objects depending on the Depth parameter.

If pagination is supported, the output will also contain metadata such as cursors (startCursor, endCursor) within a pageInfo object to facilitate fetching subsequent pages.

No binary data output is indicated for this operation.

Dependencies

  • Requires an API key credential to authenticate requests to the external service.
  • The base URL for the API is configured via credentials.
  • The node uses standard HTTP headers for JSON content negotiation.

Troubleshooting

  • Empty results: Check the Filter property syntax and values; overly restrictive filters may return no data.
  • Invalid filter or order_by syntax: Ensure correct comparator names and field names are used as per API documentation.
  • Pagination issues: Use valid cursor values from previous responses when setting Starting After or Ending Before.
  • Authentication errors: Verify that the API key credential is correctly set up and has necessary permissions.
  • API rate limits: If many requests are made quickly, the API may throttle; implement retry logic or reduce request frequency.

Links and References

  • Refer to the external API’s official documentation for detailed information on available company fields, filter syntax, and pagination mechanisms.
  • Consult n8n documentation on how to configure API credentials and use pagination in nodes.

Discussion