From ad0c1f9eadce16a889a311302e5d066f85842736 Mon Sep 17 00:00:00 2001 From: Lindsey Zylstra Date: Wed, 16 Sep 2026 14:17:49 -0700 Subject: [PATCH] Updates to n8n node docs --- .../1.n8n/directus-n8n-actions.md | 22 +++++++++++----- .../1.n8n/directus-n8n-advanced.md | 25 +++++++++++++------ 2 files changed, 34 insertions(+), 13 deletions(-) diff --git a/content/guides/13.integrations/1.n8n/directus-n8n-actions.md b/content/guides/13.integrations/1.n8n/directus-n8n-actions.md index 7f445a40..7474c043 100644 --- a/content/guides/13.integrations/1.n8n/directus-n8n-actions.md +++ b/content/guides/13.integrations/1.n8n/directus-n8n-actions.md @@ -23,18 +23,18 @@ Quick reference of all available actions organized by resource type: |----------|-----------|-------------| | **Items** | Create | Add a new item to a collection | | **Items** | Get | Retrieve a single item by ID | -| **Items** | Get Many | Retrieve multiple items with optional filters | +| **Items** | Get Many | Retrieve multiple items | | **Items** | Update | Modify an existing item | | **Items** | Delete | Permanently remove an item | | **Users** | Invite | Send an invitation to a new user | | **Users** | Get | Retrieve a single user by ID | -| **Users** | Get Many | Retrieve multiple users with optional filters | +| **Users** | Get Many | Retrieve multiple users | | **Users** | Update | Modify an existing user | | **Users** | Delete | Permanently remove a user | | **Files** | Upload a File | Upload a file from binary data | | **Files** | Import a File | Import a file from a URL | | **Files** | Get | Retrieve a single file by ID | -| **Files** | Get Many | Retrieve multiple files with optional filters | +| **Files** | Get Many | Retrieve multiple files | | **Files** | Update | Modify file metadata | | **Files** | Delete | Permanently remove a file | @@ -62,9 +62,18 @@ Delete operations permanently remove data. Make sure this is what you want to do ### Get Operations - **Get**: Set Resource → Operation to Get → Enter ID → Optionally select **Fields** to return -- **Get Many**: Set Resource → Operation to Get Many → Optionally add filters → Set **Limit** → Optionally select **Fields** +- **Get Many**: Set Resource → Operation to Get Many → Select Collection (Items only) → Optionally select **Fields** → Set **Limit** or enable **Return All**. For Users and Files, optionally enable **Simplify**. -**Note for Items**: Select the **Collection** before configuring filters. +**Note for Items**: Select the **Collection** first. To filter results, use [Get Many (Raw JSON)](/guides/integrations/n8n/directus-n8n-advanced). + +**Return All** is off by default. With it off, you get one page of up to **Limit** rows (maximum 100). With it on, you get all results. + +::callout{icon="i-lucide-triangle-alert" color="warning"} +**Return All loads all results into n8n** +That means many API calls and a large item output. Prefer **Limit**, or a filter in [Get Many (Raw JSON)](/guides/integrations/n8n/directus-n8n-advanced), on large collections. Select only the fields you need. Huge collections can hit n8n memory or timeout limits. Use **Return All** when you need the rest of a set, not to dump the whole CMS. + +To process rows in chunks, use Get Many (Raw JSON) with `limit` and `offset`, or n8n's **Split In Batches** node. Do not use **Return All** for batched writes. +:: ## Resource-Specific Operations @@ -116,7 +125,7 @@ When getting items, you can select specific fields to return. This is helpful wh - You only need certain information - You want to reduce the amount of data transferred -- You're working with large collections +- You're working with large collections, including **Return All** runs ::callout{icon="i-lucide-info"} **Performance Tip** @@ -159,6 +168,7 @@ If you encounter issues: ## Next Steps - **[← Back to Overview](/guides/integrations/n8n)** Return to the integration overview +- **[Learn about Advanced Features →](/guides/integrations/n8n/directus-n8n-advanced)** Filters, query parameters, and Get Many (Raw JSON) - **[Learn about Directus Triggers →](/guides/integrations/n8n/directus-n8n-triggers)** Set up automated workflows diff --git a/content/guides/13.integrations/1.n8n/directus-n8n-advanced.md b/content/guides/13.integrations/1.n8n/directus-n8n-advanced.md index 4543ddf9..f11cf074 100644 --- a/content/guides/13.integrations/1.n8n/directus-n8n-advanced.md +++ b/content/guides/13.integrations/1.n8n/directus-n8n-advanced.md @@ -36,7 +36,7 @@ Quick reference of all available raw operations organized by resource type: ::callout{icon="i-lucide-lightbulb"} **When to Use Raw Operations** -Use raw operations when you need complex filters with logical operators (`_and`, `_or`), relational field filtering, advanced query parameters (aggregation, search, etc.), or full control over the JSON payload structure. +Use raw operations when you need filters, logical operators (`_and`, `_or`), relational field filtering, advanced query parameters (aggregation, search, etc.), or full control over the JSON payload structure. :: ## Using Raw Operations @@ -59,7 +59,7 @@ Ensure your Directus API token has the correct permissions for the resource and ### Get Many (Raw JSON) -Retrieve items with advanced filtering and query parameters: +Retrieve items with advanced filtering and query parameters. Get Many (Raw JSON) returns one page of results from the query JSON as written. ```json { @@ -73,6 +73,16 @@ Retrieve items with advanced filtering and query parameters: } ``` +`limit` controls that single request: + +- Omit `limit` to get Directus's default page (usually 100), not the whole collection. +- Set `"limit": 10` to get 10 rows. +- Set `"limit": -1` to request Directus's maximum allowed page size. If [`QUERY_LIMIT_MAX`](/configuration/security-limits) is set (for example, `5`), you still only get that many rows. This is not a dump of the whole collection. + +To process a large filtered set in chunks, keep `limit` and `offset` in the query and use n8n's **Split In Batches** node. + +If you want all results and you don't need a custom filter, use standard [Get Many](/guides/integrations/n8n/directus-n8n-actions) with **Return All**. + ### Get (Raw JSON) Retrieve a single item with custom query parameters: @@ -157,7 +167,7 @@ For complete filter syntax, operators, and examples, see the [Directus Filter Ru ## Query Parameters -Get (Raw JSON) and Get Many (Raw JSON) support all Directus query parameters. Include them in the **Query Parameters** field alongside filters: +Get (Raw JSON) and Get Many (Raw JSON) support all Directus query parameters. Include them in the **Query Parameters** field alongside filters. If you omit `limit` on Get Many (Raw JSON), Directus returns its default page (usually 100), not the whole collection. **Common query parameters:** ```json @@ -226,9 +236,10 @@ You can use n8n expressions in your raw JSON data for dynamic queries: ## Performance Tips -- **Select only needed fields**: Use the `fields` parameter to reduce data transfer -- **Use pagination**: Use `limit` and `offset`/`page` for large datasets, process in batches with n8n's **Split In Batches** node -- **Filter in Directus**: Always use the `filter` parameter rather than processing all data in n8n +- **Select only the fields you need**: Use the `fields` parameter to reduce data transfer +- **Filter in Directus**: Use the `filter` parameter rather than loading extra rows into n8n +- **Paginate in chunks**: Use `limit` and `offset` for large datasets, then process batches with n8n's **Split In Batches** node. Get Many (Raw JSON) returns one page of results. +- **Return All is all-at-once**: Standard [Get Many](/guides/integrations/n8n/directus-n8n-actions) with **Return All** returns all results into n8n in one node run. Use it when you need the rest of a set and you don't need a custom filter. Do not use it to dump a large collection, or when you need to write out rows in chunks. **Example:** ```json @@ -249,7 +260,7 @@ You can use n8n expressions in your raw JSON data for dynamic queries: ## Next Steps - **[← Back to Overview](/guides/integrations/n8n)** Return to the integration overview -- **[Learn about Directus Actions →](/guides/integrations/n8n/directus-n8n-actions)** Basic operations guide +- **[Learn about Directus Actions →](/guides/integrations/n8n/directus-n8n-actions)** Standard Get Many, Return All, and other operations - **[Learn about Directus Triggers →](/guides/integrations/n8n/directus-n8n-triggers)** Automation workflows