Actions22
Overview
The node interacts with the Distru API to retrieve or manipulate data related to various business entities. Specifically, for the Get Strain operation, it fetches strain records from the Distru system. This operation supports filtering and pagination, allowing users to query strains based on creation or update timestamps and control the number of results returned per page.
This node is beneficial in scenarios where you need to integrate cannabis strain data into workflows, such as syncing strain information with other systems, generating reports, or automating inventory management processes involving strains.
Example use cases:
- Retrieve a list of all strains updated after a certain date.
- Paginate through strain records to synchronize them incrementally.
- Fetch specific strain details by ID for further processing.
Properties
| Name | Meaning |
|---|---|
| Inserted Datetime | Filter strains by their creation datetime (ISO 8601 format). |
| Updated Datetime | Filter strains by their last updated datetime (ISO 8601 format). |
| Page Number | The page number of results to return (used for pagination). Defaults to 1. |
| Page Size | The number of results per page to return (used for pagination). Defaults to 100. |
These properties are provided under the "Additional Fields" collection when the operation is set to "Get Strain". They allow fine-tuning the query to the Distru API.
Output
The output is an array of JSON objects representing strain records retrieved from the Distru API. Each item corresponds to one strain and contains all available fields as returned by the API under the json property.
The structure typically includes strain attributes such as:
id: Unique identifier of the strain.- Other strain-specific metadata (not explicitly detailed in the source code).
No binary data output is produced by this operation.
Dependencies
- Requires an API token credential for authenticating requests to the Distru API.
- The base URL for API requests depends on whether staging mode is enabled in credentials:
- Production:
https://app.distru.com/public/v1 - Staging:
https://staging.distru.com/public/v1
- Production:
- The node uses HTTP GET requests with Bearer token authorization to interact with the API.
Troubleshooting
Missing API Token: If the API token is not set in the credentials, the node will throw an error:
"Distru API token is not set!"
Resolution: Ensure that the API token credential is configured correctly in n8n.Invalid UUID or ID Format: The node normalizes IDs to UUID format before making requests. Providing invalid IDs may cause API errors.
Resolution: Verify that IDs used in filters or parameters conform to expected formats.Pagination Issues: If too many results are requested or page numbers are incorrect, the API might return empty or incomplete data.
Resolution: AdjustPage NumberandPage Sizeproperties appropriately.API Errors: Any HTTP or API-level errors will be thrown unless "Continue On Fail" is enabled, in which case error messages are returned in the output JSON under an
errorfield.
Links and References
- Distru API Documentation (general reference for API endpoints and data models)
- n8n Documentation (for configuring credentials and using nodes)
This summary focuses exclusively on the Get Strain operation of the Distru node as requested.