Describe the issue/error/question
My application interacts with n8n api to create, update and execute n8n workflows.
I want to write some integration tests and for that I build a docker compose before running tests:
version: '3.8'
volumes:
n8n_db_storage:
redis_storage:
x-shared: &shared
image: n8nio/n8n
restart: always
environment:
- DB_TYPE=postgresdb
- DB_POSTGRESDB_HOST=postgres
- DB_POSTGRESDB_PORT=5432
- DB_POSTGRESDB_DATABASE=n8n
- DB_POSTGRESDB_USER=n8n
- DB_POSTGRESDB_PASSWORD=45yJTe9Soc%t
- EXECUTIONS_MODE=queue
- QUEUE_BULL_REDIS_HOST=redis
- QUEUE_HEALTH_CHECK_ACTIVE=true
- N8N_CUSTOM_EXTENSIONS=/home/app/modules
links:
- postgres
- redis
volumes:
- dist:/home/app/modules
- node_modules:/home/app/modules/node_modules
depends_on:
redis:
condition: service_healthy
postgres:
condition: service_healthy
services:
postgres:
image: postgres:11
restart: always
environment:
- POSTGRES_USER=n8n
- POSTGRES_PASSWORD=45yJTe9Soc%t
- POSTGRES_DB=n8n
volumes:
- n8n_db_storage:/var/lib/postgresql/data
ports:
- 5432:5432
healthcheck:
test: ['CMD-SHELL', 'pg_isready -h localhost -U n8n -d n8n']
interval: 5s
timeout: 5s
retries: 10
redis:
image: redis:6-alpine
restart: always
volumes:
- redis_storage:/data
ports:
- 6379:6379
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
interval: 5s
timeout: 5s
retries: 10
n8n:
<<: *shared
command: /bin/sh -c "n8n start"
ports:
- 5678:5678
n8n-worker:
<<: *shared
command: /bin/sh -c "sleep 5; n8n worker"
depends_on:
- n8n
Now I want to create an integration test that creates workflow.
My question is how to create an API KEY
as this test runs in CI server and every time its a fresh new n8n instance?
What is the error message (if any)?
N/A
Please share the workflow
N/A
Share the output returned by the last node
N/A
Information on your n8n setup
- n8n version: 0.213.0
- Database you’re using (default: SQLite): Postgres
- Running n8n with the execution process [own(default), main]: main
- Running n8n via [Docker, npm, n8n.cloud, desktop app]: Docker