| --- |
| title: N8n |
| emoji: ⚡ |
| colorFrom: blue |
| colorTo: gray |
| sdk: docker |
| pinned: false |
| license: mit |
| short_description: n8n free hosted with supebase |
| --- |
| Created by **[ABCDO](https://abcdo.tn/)** & [EnzGamers](https://huggingface.co/EnzGamers) . |
| Check out the configuration reference at [spaces-config-reference](https://huggingface.co/docs/hub/spaces-config-reference) . |
| -- |
|
|
| # n8n - Extended Workflow Automation on Hugging Face Spaces |
|
|
| This Hugging Face Space runs a powerful, extended instance of [n8n](https://n8n.io/), an open-source, fair-code, and self-hostable workflow automation tool. |
|
|
| This isn't just the standard n8n. This custom Docker image comes pre-loaded with a wide range of system dependencies, designed to support a vast array of community nodes and complex workflows right out of the box, without any extra configuration. |
|
|
| ## ✨ Key Features of This Custom Image |
|
|
| - **Based on Node.js 20**: Built on a modern and efficient `node:20-alpine` base image. |
| - **Chromium Included**: Full support for browser automation, web scraping, and PDF generation nodes thanks to the pre-installed `chromium`. |
| - **Python & Git Ready**: Comes with `python3`, `pip`, and `git` installed, allowing you to run scripts and interact with repositories directly within your workflows. |
| - **Build Tools Pre-installed**: Includes `build-base`, `g++`, and `make` to ensure compatibility with nodes that require compiling native addons. |
| - **Database Clients**: `postgresql-client` is included for easy connection to external PostgreSQL databases. |
| - **Graphics Libraries**: `cairo-dev` and `pango-dev` are available for nodes that perform canvas or image manipulation. |
|
|
| ## 🚀 How to Use |
|
|
| 1. **Launch the Space**: This Space will build the Docker container and start n8n automatically. Please be patient during the initial startup. |
| 2. **Access n8n**: Once the application is running, the n8n editor will be available to use. |
| 3. **Start Automating**: Begin building your workflows! You can now use many community nodes that would typically fail in a standard setup. |
|
|
| ### Data Persistence |
|
|
| By default, this Space uses SQLite to store your workflows and credentials, which are saved to the container's local filesystem (`/root/.n8n`). |
|
|
| **Important**: The filesystem of a Hugging Face Space is ephemeral. To ensure your workflows are not lost when the Space restarts, you should: |
| 1. **Download Your Workflows**: Regularly download your important workflows as JSON files from the n8n UI. |
| 2. **Commit to Repository**: For a more advanced setup, you can configure a process to commit your workflow files (`/root/.n8n/workflows/*.json`) back to the Space's Git repository. |
|
|
| ## ⚙️ Configuration (Using Space Secrets) |
|
|
| For a secure and customized setup, you should configure n8n using Hugging Face Space Secrets. You can find these in your Space's **Settings** tab. |
|
|
| | Secret Key | Description | Example Value | |
| | --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ | |
| | `N8N_ENCRYPTION_KEY` | **(Highly Recommended)** A long, random, and secret key to encrypt your credentials. If not set, credentials are less secure. | `your_very_secret_and_long_encryption_key` | |
| | `GENERIC_TIMEZONE` | Sets the server timezone to ensure CRON nodes and date-based triggers run at the correct time. A list of timezones can be found [here](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). | `Europe/Berlin` | |
| | `NODE_FUNCTION_ALLOW_EXTERNAL` | Comma-separated list of external npm modules to allow in the Function and Edit Fields nodes (e.g., `axios,lodash`). | `axios,moment` | |
| | `WEBHOOK_URL` | **(Required for Production)** Manually set the public-facing webhook URL. It should be the URL of your Hugging Face Space. | `https://your-space-name.hf.space/` | |
|
|
| ### Connecting to an External Database |
|
|
| While SQLite is fine for testing, you can connect to an external PostgreSQL database (ex: Supabase 😉) for a more robust, production-ready setup. Simply set the following secrets: |
|
|
| - `DB_TYPE`: `postgresdb` |
| - `DB_POSTGRESDB_HOST`: Your database host |
| - `DB_POSTGRESDB_DATABASE`: Your database name |
| - `DB_POSTGRESDB_USER`: Your database user |
| - `DB_POSTGRESDB_PASSWORD`: Your database password |
| - `DB_POSTGRESDB_PORT`: `5432` |
|
|
| ## 🐳 About the Dockerfile |
|
|
| This instance is built from the provided `Dockerfile`. Here is a summary of its setup: |
|
|
| - **Base Image**: `node:20-alpine` |
| - **n8n Version**: `Latset` |
| - **System Dependencies**: Installs `git`, `python3`, `chromium`, `build-base`, `postgresql-client`, and more using `apk`. |
| - **Environment**: Sets up `PUPPETEER_EXECUTABLE_PATH` to work with the bundled Chromium. |
| - **Directories**: Creates and sets appropriate permissions for the n8n data directory at `/root/.n8n`. |
| - **Execution**: Starts n8n using the default `n8n start` command. |