Actions60
- User Actions
- Channel Actions
- Accept Invite
- Add Members
- Add Moderators
- Archive
- Ban User
- Create
- Delete
- Delete File
- Delete Image
- Demote Moderators
- Disable Slow Mode
- Enable Slow Mode
- Get Config
- Hide
- Invite Members
- Mark Read
- Mark Unread
- Mute
- Mute Status
- Pin
- Query Channels
- Query Members
- Reject Invite
- Remove Members
- Send Action
- Send File
- Send Image
- Show
- Stop Watching
- Truncate
- Unarchive
- Unban User
- Unmute
- Unpin
- Update
- Watch
- Message Actions
- Moderation Actions
Overview
The node performs server-side operations for managing users in a Stream Chat application. Specifically, the "Upsert Multiple" operation allows you to create or update multiple user records in bulk by providing an array of user objects. This is useful when you need to synchronize or batch import user data into your chat system efficiently.
Common scenarios include:
- Importing a list of new users from an external database.
- Updating multiple existing users with new profile information or custom fields.
- Bulk synchronization of user data during migrations or periodic updates.
Example: Upserting multiple users with IDs and names:
[
{"ID": "user1", "name": "John"},
{"ID": "user2", "name": "Jane"}
]
This operation will create these users if they don't exist or update their details if they do.
Properties
| Name | Meaning |
|---|---|
| Users Data | An array of user objects to upsert. Each object should contain user properties such as ID, name, email, role, etc. Example: [{"ID": "user1", "name": "John"}, {"ID": "user2", "name": "Jane"}] |
Output
The output JSON contains the result of the upsert operation for the provided users. It typically includes the updated or created user objects with their properties as stored in the Stream Chat backend.
If the operation succeeds, the output JSON array will reflect the current state of each user after the upsert.
No binary data is produced by this operation.
Dependencies
- Requires a valid API key credential with permissions to manage users in the Stream Chat service.
- The node uses the Stream Chat server-side client SDK internally.
- Proper configuration of the API credentials in n8n is necessary for authentication.
Troubleshooting
- Invalid JSON input: Ensure that the "Users Data" property contains valid JSON representing an array of user objects. Malformed JSON will cause parsing errors.
- Missing user IDs: Each user object must have a unique identifier (commonly under the "ID" field). Missing or duplicate IDs may cause failures or unexpected behavior.
- API permission errors: If the API key lacks permissions to create or update users, the operation will fail. Verify the API key's scope and roles.
- Network or connectivity issues: Temporary network problems can cause request failures. Retry or check network settings.
- Error messages: Errors thrown by the node will indicate the resource and operation causing the issue, e.g., "Error in user.upsertUsers operation". Review the error message for details.
Links and References
- Stream Chat Documentation - Users
- Stream Chat Server SDK
- MongoDB Query Syntax (used in other operations) (for reference on filters in related operations)