n8n
n8n is a workflow automation platform for connecting APIs, services, and custom logic. Use this component when you need Diploi to build and deploy n8n so you can focus on building workflows, not configuring runtime environments.
Add to your project
Section titled “Add to your project”Paste this entry into the components list in diploi.yaml to add n8n to your project.
components: - name: n8n identifier: n8n package: https://github.com/diploi/component-n8n#v2.29.1Database
Section titled “Database”n8n stores its data in PostgreSQL. When you pick n8n in the Stack Builder, the PostgreSQL add-on and the environment variable mapping below are added to your project automatically. If you add n8n to an existing project by editing diploi.yaml yourself, add them too:
components: - name: n8n identifier: n8n package: https://github.com/diploi/component-n8n#v2.29.1 env: include: - postgres.POSTGRES_HOST:DB_POSTGRESDB_HOST - postgres.POSTGRES_PORT:DB_POSTGRESDB_PORT - postgres.POSTGRES_USER:DB_POSTGRESDB_USER - postgres.POSTGRES_PASSWORD:DB_POSTGRESDB_PASSWORDaddons: - name: PostgreSQL identifier: postgres package: https://github.com/diploi/addon-postgres#v18.3-pgvectorThe mapping is needed because n8n only reads the variable names listed in its documentation.
AI models
Section titled “AI models”To use Diploi-hosted models in n8n, create an OpenAI credential that points at the AI Gateway:
- Base URL:
{diploi-ai-gateway-url}/openai/v1 - API key:
{diploi-ai-gateway-token}
Inject those placeholders as env vars on the n8n component, then pick a supported model. See AI Gateway.
n8n reference
Section titled “n8n reference”What n8n defines in a deployment.
Environment variables
Section titled “Environment variables”n8n sets these values in every deployment.
Other components can import them with env.include as n8n.*.
Defaults marked generated are unique to each deployment.
Parameters are set on the deployment’s Setup tab.
Connection
Superuser & connection configuration.
| Variable | Type | Default | Description |
|---|---|---|---|
DB_POSTGRESDB_DATABASE |
string | n8n |
|
N8N_HOST |
string | generated |
Config
n8n onfiguration variables.
| Variable | Type | Default | Description |
|---|---|---|---|
N8N_ENCRYPTION_KEY |
secret | generated |
Other variables
Set by the package. Override them on the deployment’s Environment tab or in diploi.yaml.
| Variable | Default |
|---|---|
DB_TYPE |
postgresdb |
DB_POSTGRESDB_SCHEMA |
public |
TZ |
UTC |
N8N_SAMESITE_COOKIE |
none |
N8N_SECURE_COOKIE |
true |
Readme
Section titled “Readme”Start a demo, no card required https://diploi.com/component/n8n
A generic n8n component ready to be used for automating tasks.
This component uses latest stable N8N docker version and it uses PostgreSQL by default.
This component is based on the official n8n Docker image, ensuring compatibility and stability with the latest n8n releases.
Operation
Section titled “Operation”Getting started
Section titled “Getting started”- In the Dashboard, click Create Project +
- Under Pick Components, choose n8n
- In Pick Add-ons, you can add one or multiple databases to your app
- Choose Create Repository, which will generate a new GitHub repo
- Lastly, click Launch Stack
Link to guide, explains how to add a custom domain and launch to production https://diploi.com/blog/hosting_n8n
Configure a custom base URL
Section titled “Configure a custom base URL”-
Open the n8n web interface and create a new custom credential.
-
In the DevPod terminal, run the following command to find your Diploi base URL and access token:
Terminal window printenv | grep DIPLOI -
Return to n8n and use the retrieved values to configure your custom base URL. For detailed instructions, see the n8n community guide.
Keep your access token private and do not share it publicly.
Development and Production
Section titled “Development and Production”For development and production, the component’s image is built using the official n8n stable release, ensuring reliability and optimal performance in deployment environments.
IMPORTANT
Section titled “IMPORTANT”- If you want to create your own custom nodes, you can follow n8n’s official documentation https://docs.n8n.io/integrations/creating-nodes/build/