Actions23
Thread → Get
AI-generatedOverview
This node interacts with the "Thread" resource of the Plain API, specifically supporting the Get operation. It allows retrieving thread data in various ways: by thread ID, external ID, customer ID, or customer email. This flexibility enables users to fetch specific threads or collections of threads related to customers.
Common scenarios include:
- Fetching a single thread by its unique identifier for detailed inspection.
- Retrieving all threads associated with a particular customer, either by their ID or email address, useful for customer support workflows.
- Looking up threads by an external ID when integrating with other systems that use custom identifiers.
Practical example:
- A support automation workflow where incoming tickets (threads) are fetched by customer email to display all ongoing conversations before responding.
Properties
| Name | Meaning |
|---|---|
| Get By | Method to identify the thread(s) to retrieve. Options: Thread ID, External ID, Customer ID, Customer Email. |
| Thread ID | The unique identifier of the thread to retrieve (required if "Get By" is Thread ID). |
| External ID | The external identifier of the thread (required if "Get By" is External ID). |
| Customer ID | The customer ID to get threads for (required if "Get By" is Customer ID). |
| Customer Email | The customer email address to get threads for (required if "Get By" is Customer Email). |
| Customer ID (for External ID) | The customer ID required when looking up a thread by external ID. |
| Additional Fields | Collection of optional parameters: |
| - Limit | Maximum number of threads to return (used when getting multiple threads; 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 priorities. |
| - Assigned to User ID | Filter threads assigned to a specific user ID. Leave empty for all. |
| - Is Assigned | Filter by assignment status. Options: All, Assigned, Unassigned. |
Output
The output JSON structure depends on the "Get By" method and the number of threads retrieved:
When fetching a single thread (by Thread ID or External ID), the output contains detailed thread information including:
id: Thread unique identifier.externalId: External identifier.customer: Object with customer details (id,fullName,email).status: Current status of the thread.statusChangedAt: Timestamp of last status change.title: Thread title.previewText: Preview text of the thread content.priority: Priority level.assignedTo: Information about the assigned user or system.labels: Array of labels attached to the thread.threadFields: Custom fields with their values.createdAtandupdatedAt: Timestamps.
When fetching multiple threads (e.g., by Customer ID or Email, or using "getAll"), the output includes:
threads: Array of thread objects as above.pageInfo: Pagination info such as cursors and flags for next/previous pages.- Optionally, a
summaryobject with total count and applied filters. - If fetching by customer email, the output also includes the
customerobject.
No binary data output is produced by this operation.
Dependencies
- Requires an API key credential configured in n8n to authenticate with the Plain API.
- Uses GraphQL queries and mutations to interact with the Plain API endpoints.
- No additional external dependencies beyond the configured API authentication.
Troubleshooting
Error: "Customer with email '...' not found"
Occurs when fetching threads by customer email but no matching customer exists. Verify the email address is correct and that the customer exists in the Plain system.API errors returned from Plain API
Errors from the API are thrown as node operation errors with messages from the API response. Check the error message for details, such as missing required fields or invalid IDs.Empty results
If no threads are found, the output will contain a message indicating no threads were found. Confirm the filter criteria and identifiers used are correct.Missing required parameters
For example, when "Get By" is set to External ID, the customer ID must also be provided. Ensure all required fields are filled.
Links and References
- Plain API Documentation (GraphQL): https://docs.plain.com/api/graphql (example placeholder link)
- n8n Documentation on creating custom nodes: https://docs.n8n.io/integrations/creating-nodes/