Actions23
Tenant → Create or Update
AI-generatedOverview
This node interacts with the Plain API to manage tenants, specifically supporting creation or update operations for tenant entities. It allows users to upsert (create or update) tenant records by specifying key identifiers and additional optional details.
Common scenarios where this node is beneficial include:
- Automating tenant management workflows in multi-tenant applications.
- Synchronizing tenant data from external systems into Plain.
- Updating tenant information dynamically based on business logic or events.
Practical example:
- You have an external system that manages tenant accounts and you want to ensure your Plain database reflects the latest tenant names and URLs. Using this node, you can upsert tenants by their external IDs, updating their names and URLs as needed.
Properties
| Name | Meaning |
|---|---|
| Name | The name of the tenant to create or update. |
| External ID | The external identifier used to uniquely identify the tenant in the system. |
| Additional Fields | Optional extra fields for the tenant; currently supports: |
| - URL: The URL associated with the tenant. |
Output
The output JSON contains the tenant object returned by the Plain API after the upsert operation. This includes:
id: Internal unique identifier of the tenant.name: Tenant's name.externalId: External identifier of the tenant.url: URL associated with the tenant (if provided).createdAtandupdatedAt: Timestamps indicating when the tenant was created and last updated.
If the operation fails, the node throws an error with a descriptive message.
No binary data output is produced by this node.
Dependencies
- Requires an API key credential configured in n8n to authenticate requests to the Plain API.
- Relies on the
plainApiRequestfunction to perform GraphQL mutations against the Plain API endpoint.
Troubleshooting
Error: "Unknown error" or specific error messages from the API
This usually indicates an issue with the input data or API credentials. Verify that the external ID and name are correctly provided and that the API key credential is valid.Field errors in the error message
If the error response includes field-specific messages, review those fields for invalid or missing values.Network or authentication failures
Ensure the API key credential is properly set up and has sufficient permissions to perform tenant upsert operations.Empty or missing output
Confirm that the input parameters meet the required conditions (nameandexternalIdare mandatory).
Links and References
- Plain API Documentation (hypothetical link, replace with actual if available)
- GraphQL Mutation: upsertTenant (hypothetical link)
Note: The above summary is based solely on static analysis of the provided source code and property definitions.