Actions23
Tenant → Set Customer Tenants
AI-generatedOverview
The node interacts with the Plain API to manage tenants and their relationships with customers. Specifically, for the Tenant resource and the Set Customer Tenants operation, it allows you to assign a set of tenants to a specific customer, effectively replacing any existing tenant associations for that customer.
This operation is useful in scenarios where you want to synchronize or update the list of tenants linked to a customer in bulk, ensuring the customer's tenant memberships are exactly as specified.
Practical example:
You have a customer identified by email address, and you want to set their associated tenants to a new list of tenants identified by tenant IDs or external IDs. This node operation will replace all previous tenant associations with the new list.
Properties
| Name | Meaning |
|---|---|
| Customer Identifier | Specifies how to identify the customer. Options: Customer ID, Email Address, External ID. Depending on the choice, provide the corresponding identifier value. |
| Tenant Identifiers | A list of tenants to associate with the customer. Each tenant can be identified by either Tenant ID or External ID. Multiple tenants can be specified. |
Output
The output JSON contains the updated customer object reflecting the new tenant associations. It includes:
id: The unique identifier of the customer.fullName: The full name of the customer.email: An object containing the customer's email address.- Any error information if the operation failed.
If the operation succeeds, the output confirms the customer's updated tenant memberships. If there is an error, the output will contain error messages describing what went wrong.
Dependencies
- Requires connection to the Plain API service.
- Requires an API authentication credential configured in n8n (e.g., an API key).
- The node uses GraphQL mutations to perform the tenant assignment.
Troubleshooting
Missing Customer Identifier:
Error thrown if the customer identifier is not provided or incomplete. Ensure you specify one of the supported identifiers (Customer ID, Email Address, or External ID) with a valid value.Missing Tenant Identifiers:
Error occurs if no tenant identifiers are provided or if the tenant data is incomplete. Provide at least one tenant with a valid Tenant ID or External ID.API Errors:
If the Plain API returns errors (e.g., invalid IDs, permission issues), the node throws an error with the message returned by the API. Review the error message for details and verify your input data and API permissions.Field Errors:
Sometimes the API returns field-specific errors. These are included in the error message to help pinpoint which input fields caused the problem.
Links and References
- Plain API Documentation (Replace with actual URL if available)
- n8n Documentation on Creating Custom Nodes
- GraphQL Mutation Reference for tenant management in Plain API (internal documentation)
If you need further assistance with other operations or resources, feel free to ask!