I want to integrate n8n with my Django multi-tenant application where each tenant has their own database schema named tenant_[tenant_id]_schema. Each instance/tenant has their own users/admins, and I need to ensure that when someone accesses n8n, they can only interact with their own tenant’s database tables based on their tenant ID.
Specifically, I need:
A way to dynamically restrict database access based on the user’s tenant ID
Automatically prefix all database queries with the correct schema (tenant_[tenant_id]_schema)
Maintain tenant isolation across all workflows and credentials
Integrate with my existing Django authentication system
Has anyone implemented a similar multi-tenant architecture with n8n? What’s the recommended approach - custom nodes, middleware, or separate n8n instances per tenant? Are there enterprise features or community nodes that might help with this use case?
What is the error message (if any)?
No error yet, as I’m in the planning phase trying to determine the best implementation approach.
Please share your workflow
Not applicable as I’m seeking architectural guidance rather than troubleshooting a specific workflow.