Plain icon

Plain

Interact with Plain API

Thread → Get All

AI-generated

Overview

The node interacts with the "Plain" API to manage threads related to customers. Specifically, the Thread - Get All operation retrieves multiple threads based on various filtering criteria. This is useful for scenarios where you want to list or analyze all communication threads associated with customers, such as support tickets, conversations, or task threads.

Practical examples include:

  • Fetching all open or pending threads assigned to a specific user.
  • Retrieving threads filtered by priority or status to prioritize work.
  • Listing threads linked to a particular customer for review or reporting.

Properties

Name Meaning
Additional Fields Collection of optional filters and parameters:
- Limit Maximum number of threads to return (default 50).
- Status Filter Filter threads by status; options: Todo, Snoozed, Done. Leave empty to include all statuses.
- Priority Filter Filter threads by priority; options: Urgent (0), High (1), Normal (2), Low (3). Leave empty for all.
- Assigned to User ID Filter threads assigned to a specific user ID. Leave empty to include all.
- Is Assigned Filter by assignment status; options: All, Assigned, Unassigned.

These properties allow fine-tuning the query to retrieve only relevant threads.

Output

The output JSON structure contains an array of thread objects with detailed information for each thread:

  • id: Thread unique identifier.
  • externalId: External identifier if set.
  • customer: Object containing customer details (id, fullName, email).
  • status: Current status of the thread (e.g., TODO, SNOOZED, DONE).
  • statusChangedAt: Timestamp when the status last changed.
  • title: Title of the thread.
  • previewText: Preview text snippet from the thread content.
  • priority: Numeric priority level (0 = Urgent, 3 = Low).
  • assignedTo: Object describing the assigned user or system entity.
  • labels: Array of labels attached to the thread, each with id and label type info.
  • threadFields: Custom fields associated with the thread, including their types and values.
  • createdAt / updatedAt: Timestamps for creation and last update.
  • _metadata: Metadata including applied filters, pagination info, and optionally customer data.

If no threads are found, the output includes a message indicating this along with the filters used and pagination info.

Dependencies

  • Requires an API key credential for authenticating with the Plain API.
  • The node uses GraphQL queries/mutations to interact with the Plain service.
  • Pagination and filtering depend on the API's support for cursors and filter objects.
  • Some input options dynamically load available users, label types, and custom field schemas via additional API calls.

Troubleshooting

  • No threads returned: Check that your filters (status, priority, assigned user) are correct and that the limit is sufficient.
  • API errors: Errors returned from the Plain API will be thrown with descriptive messages. Common causes include invalid IDs, missing required fields, or permission issues.
  • Invalid filter values: Ensure multi-select filters use valid option values (e.g., status must be one of TODO, SNOOZED, DONE).
  • Pagination issues: If using cursor-based pagination (after/before), verify that cursors are correctly passed between requests.
  • Empty enum or custom field options: Dynamic loading of custom fields may fail if the API schema changes or network issues occur.

Links and References


This summary covers the logic and usage of the "Thread - Get All" operation in the Plain node based on static code analysis and provided property definitions.

Discussion