Directus (DrWade) icon

Directus (DrWade)

Consume Directus API

Overview

The Directus (DrWade) n8n node for the Users resource with the Create Multiple operation allows you to create multiple user accounts in a Directus instance in a single workflow execution. This is particularly useful for bulk onboarding, migrations, or automated provisioning of users from external systems.

Practical scenarios:

  • Importing a list of new employees into Directus as users.
  • Migrating users from another system by providing their details in bulk.
  • Automating user creation based on data from other n8n nodes or external APIs.

Properties

Name Type Meaning
Data (JSON) json An array of partial user objects. Each object should contain user properties such as email, password, and role. Used to define new users.

Example input:

[
  {
    "email": "admin@example.com",
    "password": "p455w0rd",
    "role": "c86c2761-65d3-43c3-897f-6f74ad6a5bd7"
  },
  {
    "email": "another@example.com",
    "password": "d1r3ctu5",
    "role": "c86c2761-65d3-43c3-897f-6f74ad6a5bd7"
  }
]

Output

  • The output will be an array of JSON objects, each representing a created user as returned by the Directus API.
  • Each object contains the fields of the created user, which may include:
    • id
    • email
    • role
    • Other user-related fields as defined in your Directus instance.

Example output:

{
  "id": "1234-5678-90ab-cdef",
  "email": "admin@example.com",
  "role": "c86c2761-65d3-43c3-897f-6f74ad6a5bd7",
  // ...other user fields
}
  • If an error occurs and "Continue On Fail" is enabled, the output will include an error field with the error message.

Dependencies

  • Directus API: You must have access to a running Directus instance.
  • API Credentials: The node requires valid Directus API credentials configured in n8n under the name directusApi.
  • n8n Configuration: No special environment variables are required beyond standard credential setup.

Troubleshooting

Common issues:

  • Invalid JSON in Data (JSON): Ensure the input is a valid JSON array of user objects.
  • Missing Required Fields: Each user object should at least include email, password, and role.
  • Role ID Issues: The role property must reference a valid role ID in your Directus instance.
  • Duplicate Emails: Attempting to create users with emails that already exist will result in errors from Directus.
  • Insufficient Permissions: The API credentials used must have permission to create users.

Error messages:

  • "error": "Request failed with status code 400" — Check your input data for missing or invalid fields.
  • "error": "Role not found" — Verify that the provided role IDs exist in Directus.
  • "error": "Email already exists" — Ensure all emails are unique.

Links and References

Discussion