Actions22
Overview
The node interacts with the Distru API to retrieve or manipulate data related to various business entities such as assemblies, batches, companies, products, orders, contacts, inventory, invoices, locations, packages, purchases, stock adjustments, strains, users, and payment methods.
Specifically, for the Get Assembly operation, the node fetches assembly records from Distru. It supports filtering and pagination options to refine the results.
This node is beneficial in scenarios where you want to automate workflows involving inventory assemblies, such as syncing assembly data into other systems, monitoring assembly creation, or reporting on assembly statuses.
Example use cases:
- Automatically retrieving new or updated assembly records for inventory reconciliation.
- Filtering assemblies by creation source or license number to generate reports.
- Paginating through large sets of assembly data for batch processing.
Properties
| Name | Meaning |
|---|---|
| Additional Fields | A collection of optional filters and pagination settings for the Get Assembly operation: |
| - Creation Source | Type of assembly; options: Manually Created, Split Package, Sales Order, Lab Testing |
| - License Number | Filter assemblies by their license number (string) |
| - Inserted Datetime | Filter assemblies by their creation datetime (ISO 8601 date-time) |
| - Page Number | Page of results to return (pagination), default is 1 |
| - Page Size | Number of results per page (pagination), default is 100 |
Output
The output is an array of items, each containing a json field with the assembly data retrieved from the Distru API.
- The
jsonobject represents one assembly record with all its properties as returned by the API. - If a specific assembly ID is provided, the output will contain only that assembly's data.
- If no ID is specified, the output contains multiple assembly records according to the applied filters and pagination.
- No binary data is output by this node.
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:
- Staging:
https://staging.distru.com/public/v1 - Production:
https://app.distru.com/public/v1
- Staging:
- The node uses HTTP GET requests to fetch assembly data.
- Proper configuration of the API token credential in n8n is necessary.
Troubleshooting
Missing API Token:
Error: "Distru API token is not set!"
Resolution: Ensure the API token credential is configured correctly in n8n.Invalid Filters or Parameters:
If filters like license number or inserted datetime are malformed, the API may return errors or empty results.
Resolution: Verify filter values conform to expected formats (e.g., ISO 8601 for dates).Pagination Issues:
Requesting pages beyond available data returns empty arrays.
Resolution: Adjust page number and size parameters appropriately.Network or Authentication Errors:
Errors from the API due to network issues or invalid tokens will be thrown.
Resolution: Check network connectivity and validity of the API token.
Links and References
- Distru API Documentation (general reference for API endpoints and data models)
- n8n Documentation (for configuring credentials and using nodes)