Directus icon

Directus

Consume Directus API

Overview

This node integrates with the Directus API to manage Webhooks among other resources. Specifically, for the Webhooks - List operation, it retrieves a list of webhooks configured in a Directus instance. This is useful when you want to programmatically fetch all webhook configurations for monitoring, auditing, or further processing within an automation workflow.

Typical use cases include:

  • Synchronizing webhook configurations between environments.
  • Auditing existing webhooks to ensure they match expected criteria.
  • Exporting webhook data for reporting or backup purposes.

For example, you might use this node to fetch all webhooks and then filter or transform them before sending notifications or updating another system.

Properties

Name Meaning
Return All Boolean flag to return all webhook results or limit the number returned.
Limit Number specifying the maximum number of webhook objects to return (used if Return All is false). Valid range: 1 to 100.
Split Into Items Boolean indicating whether to output each webhook as a separate item or as a single array.
JSON/RAW Parameters Boolean to choose whether to provide query/body parameters via UI fields or as raw JSON input.
Body Parameters JSON object containing body parameters for the request when using JSON/RAW mode.
Additional Fields Collection of optional parameters to customize the request, including:
- Aggregate Aggregation functions like count, sum, average, min, max on specified fields.
- Binary Property for Export Data Name of the binary property where exported data will be saved.
- Deep (JSON) Nested relational dataset query parameters in JSON format.
- Export Format to save the API response file: JSON, CSV, or XML.
- Fields Comma-separated string to specify which fields to return in the response.
- File Name for Export Data Filename (without extension) for the exported data file.
- Filter (JSON) JSON conditions to filter the collection items.
- Group By Field(s) to group aggregation results by, e.g., "author" or "year(publish_date)".
- Meta Metadata fields to include in the response.
- Offset Number of items to skip when fetching data (for pagination).
- Search String to filter items containing this search query in any field.
- Sort CSV string defining sorting order of returned items. Prefix with "-" for descending, "?" for random sort.

Output

The node outputs the retrieved webhooks data in the json field of each item. The structure corresponds directly to the webhook objects returned by the Directus API, typically including properties such as webhook ID, name, URL, actions triggered, collections involved, and other metadata.

If the Export option is used, the node also outputs the API response as a binary file in the specified format (JSON, CSV, or XML) under the binary property named by Binary Property for Export Data (default "data"). This allows downstream nodes to handle the export file, e.g., saving it to disk or sending it via email.

When Split Into Items is enabled, each webhook object is output as a separate item; otherwise, all are output as a single array in one item.

Dependencies

  • Requires a valid connection to a Directus instance via an API key credential configured in n8n.
  • The node uses the Directus REST API endpoints for webhooks.
  • No additional external dependencies beyond the Directus API and n8n environment.

Troubleshooting

  • Authentication errors: Ensure the API key credential is correctly set up and has permissions to access webhooks.
  • Invalid JSON in parameters: When using JSON/RAW parameters, invalid JSON syntax will cause parsing errors. Validate JSON before input.
  • Limit exceeded: If Limit is set above 100, the API may reject the request. Keep within allowed ranges.
  • Empty results: Check filters, search, and other parameters to ensure they match existing webhooks.
  • Export issues: If exporting, verify that the binary property name does not conflict with existing data and that downstream nodes can handle the binary data.

Links and References

Discussion