TwentyDEV icon

TwentyDEV

Consume the Twenty API

Actions252

Overview

The "Find Many Attachments" operation in the Attachments resource allows users to retrieve multiple attachment objects from a data source with flexible filtering, sorting, and pagination options. This node is useful when you need to query and list attachments based on specific criteria, such as filtering by fields, ordering results, limiting the number of returned items, or controlling the depth of related nested objects included in the response.

Practical examples include:

  • Fetching all attachments uploaded after a certain date.
  • Retrieving attachments related to a particular project or user.
  • Paginating through large sets of attachments for display in a UI.
  • Sorting attachments by creation date or name.

Properties

Name Meaning
Order By Specifies how to sort the returned attachments. Format: field_name_1,field_name_2[DIRECTION_2],.... Directions can be AscNullsFirst, AscNullsLast, DescNullsFirst, DescNullsLast. Default direction is AscNullsFirst. Example: createdAt,updatedAtDescNullsLast sorts by creation date ascending, then update date descending.
Filter Filters the attachments returned using field comparators. Format: field[COMPARATOR]:value. Supports complex filters with conjunctions (and, or, not). Comparators include eq, neq, in, containsAny, is, gt, gte, lt, lte, startsWith, like, ilike. Can filter null values and booleans. Example: status[eq]:active,id[neq]:"0000...".
Limit Limits the maximum number of attachments returned. Default is 60.
Depth Controls how many levels of nested related objects are included in the response: 0 returns only primary attachment info, 1 includes directly related objects, 2 includes related objects of those related objects. Default is 1.
Starting After Returns attachments starting after a specific cursor value (used for pagination). Cursor values come from startCursor or endCursor in the response's pageInfo.
Ending Before Returns attachments ending before a specific cursor value (used for pagination). Cursor values come from startCursor or endCursor in the response's pageInfo.

Output

The node outputs JSON data containing an array of attachment objects matching the query parameters. Each attachment object includes its fields and, depending on the depth parameter, may include nested related objects up to two levels deep.

If pagination is used, the output also contains pageInfo with cursors (startCursor, endCursor) to facilitate fetching subsequent or previous pages.

No binary data output is indicated for this operation.

Dependencies

  • Requires an API key credential or similar authentication token configured in n8n to access the underlying service.
  • The node uses HTTP requests with query parameters to interact with the external API endpoint.
  • No additional external libraries beyond the bundled OpenAPI client are required.

Troubleshooting

  • Empty results: Check that your filter syntax is correct and matches existing data. Also verify that the limit and pagination cursors are set appropriately.
  • Invalid filter or order_by format: Ensure filters use supported comparators and conjunctions, and that order directions are valid. Misformatted strings will cause errors.
  • Authentication errors: Confirm that the API key or credentials are correctly configured and have sufficient permissions.
  • Pagination issues: Use cursors from the pageInfo in the response to paginate properly. Using invalid or outdated cursors may result in no data or errors.
  • Depth too high: Setting depth above 2 is not supported and may cause unexpected behavior.

Links and References

Discussion