# yaml-language-server: $schema=https://schema.zeabur.app/template.json
apiVersion: zeabur.com/v1
kind: Template
metadata:
    name: N8N with Worker
spec:
    description: A powerful workflow automation platform with worker support
    coverImage: https://i.imgur.com/Hm4GdsP.png
    icon: https://i.imgur.com/KUcP61Z.png
    variables:
        - key: PUBLIC_DOMAIN
          type: DOMAIN
          name: Domain
          description: What is the domain you want for your N8N instance?
        - key: N8N_SHARED_ENCRYPTION_KEY
          type: STRING
          name: N8N Encryption Key
          description: Shared encryption key for n8n main and worker instances
    tags:
        - Automation
        - Workflow
    readme: |-
        # N8N with Worker 1-Click Template (create by SEAFOODHOLDHAND)

        [![N8N with Worker](https://i.imgur.com/gi4FDrn.png)](https://www.youtube.com/@seafoodholdhand)

        N8N is a powerful workflow automation platform that helps you connect different services and automate tasks. This template includes:

        - N8N main instance for workflow management (latest version)
        - N8N worker for processing background tasks
        - PostgreSQL database for data storage
        - Redis for queue management

        With N8N, you can:
        - Create automated workflows
        - Connect to hundreds of services
        - Process data and automate tasks
        - Handle background jobs efficiently

        The worker setup ensures better performance and reliability for your automation tasks.

        Note: This template enables two critical environment variables to prevent future compatibility issues:

        - `N8N_RUNNERS_ENABLED=true`: Running n8n without task runners is deprecated. Task runners will be turned on by default in a future version. This setting ensures compatibility with the upcoming changes.

        - `OFFLOAD_MANUAL_EXECUTIONS_TO_WORKERS=true`: Running manual executions in the main instance in scaling mode is deprecated. Manual executions will be routed to workers in a future version. This setting prepares your deployment for this change.

        Learn more about task runners: https://docs.n8n.io/hosting/configuration/task-runners/

        This template has been logically designed and tested to work successfully. As a nocode user, I welcome any suggestions or improvements on GitHub. I'll do my best to update the template (with AI's help) since I'm not very familiar with GitHub.

        If you encounter any issues during deployment, please let me know via GitHub issues:
        [https://github.com/glasschan/seafoodholdhand-zeabur-templates](https://github.com/glasschan/seafoodholdhand-zeabur-templates)
    services:
        - name: postgresql
          icon: https://raw.githubusercontent.com/zeabur/service-icons/main/marketplace/postgresql.svg
          template: PREBUILT_V2
          spec:
            source:
                image: postgres:17
                command:
                    - docker-entrypoint.sh
                    - -c
                    - config_file=/etc/postgresql/postgresql.conf
            ports:
                - id: database
                  port: 5432
                  type: TCP
            volumes:
                - id: data
                  dir: /var/lib/postgresql/data
            instructions:
                - title: Connection String
                  content: postgresql://${POSTGRES_USERNAME}:${POSTGRES_PASSWORD}@${PORT_FORWARDED_HOSTNAME}:${DATABASE_PORT_FORWARDED_PORT}/${POSTGRES_DATABASE}
                - title: PostgreSQL Connect Command
                  content: psql "postgresql://${POSTGRES_USERNAME}:${POSTGRES_PASSWORD}@${PORT_FORWARDED_HOSTNAME}:${DATABASE_PORT_FORWARDED_PORT}/${POSTGRES_DATABASE}"
                - title: PostgreSQL username
                  content: ${POSTGRES_USERNAME}
                - title: PostgresSQL password
                  content: ${POSTGRES_PASSWORD}
                - title: PostgresSQL database
                  content: ${POSTGRES_DATABASE}
                - title: PostgreSQL host
                  content: ${PORT_FORWARDED_HOSTNAME}
                - title: PostgreSQL port
                  content: ${DATABASE_PORT_FORWARDED_PORT}
            env:
                PGDATA:
                    default: /var/lib/postgresql/data/pgdata
                    expose: false
                POSTGRES_CONNECTION_STRING:
                    default: postgresql://${POSTGRES_USERNAME}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DATABASE}
                    expose: false
                POSTGRES_DATABASE:
                    default: ${POSTGRES_DB}
                    expose: true
                POSTGRES_DB:
                    default: zeabur
                    expose: true
                POSTGRES_HOST:
                    default: ${CONTAINER_HOSTNAME}
                    expose: true
                POSTGRES_PASSWORD:
                    default: ${PASSWORD}
                    expose: true
                POSTGRES_PORT:
                    default: ${DATABASE_PORT}
                    expose: true
                POSTGRES_URI:
                    default: ${POSTGRES_CONNECTION_STRING}
                    expose: true
                POSTGRES_USER:
                    default: root
                    expose: false
                POSTGRES_USERNAME:
                    default: ${POSTGRES_USER}
                    expose: true
            configs:
                - path: /etc/postgresql/postgresql.conf
                  template: |
                    # https://github.com/postgres/postgres/blob/master/src/backend/utils/misc/postgresql.conf.sample
                    listen_addresses = '*'
                    max_connections = 100
                    shared_buffers = 128MB
                    dynamic_shared_memory_type = posix
                    max_wal_size = 1GB
                    min_wal_size = 80MB
                    log_timezone = 'Etc/UTC'
                    datestyle = 'iso, mdy'
                    timezone = 'Etc/UTC'
                    lc_messages = 'en_US.utf8'
                    lc_monetary = 'en_US.utf8'
                    lc_numeric = 'en_US.utf8'
                    lc_time = 'en_US.utf8'
                    default_text_search_config = 'pg_catalog.english'
                  permission: null
                  envsubst: null
        - name: n8n
          icon: https://i.imgur.com/KUcP61Z.png
          template: PREBUILT_V2
          spec:
            source:
                image: docker.io/n8nio/n8n:latest
            ports:
                - id: web
                  port: 5678
                  type: HTTP
            volumes:
                - id: data
                  dir: /root/.n8n
            env:
                DB_POSTGRESDB_DATABASE:
                    default: ${POSTGRES_DB}
                    expose: false
                DB_POSTGRESDB_HOST:
                    default: ${POSTGRES_HOST}
                    expose: false
                DB_POSTGRESDB_PASSWORD:
                    default: ${POSTGRES_PASSWORD}
                    expose: false
                DB_POSTGRESDB_PORT:
                    default: ${POSTGRES_PORT}
                    expose: false
                DB_POSTGRESDB_USER:
                    default: ${POSTGRES_USERNAME}
                    expose: false
                DB_TYPE:
                    default: postgresdb
                    expose: false
                EXECUTIONS_MODE:
                    default: queue
                    expose: false
                N8N_ENCRYPTION_KEY:
                    default: ${N8N_SHARED_ENCRYPTION_KEY}
                    expose: true
                N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS:
                    default: "true"
                    expose: false
                N8N_HOST:
                    default: ${ZEABUR_WEB_DOMAIN}
                    expose: false
                N8N_RUNNERS_ENABLED:
                    default: "true"
                    expose: false
                NODE_ENV:
                    default: production
                    expose: false
                OFFLOAD_MANUAL_EXECUTIONS_TO_WORKERS:
                    default: "true"
                    expose: false
                QUEUE_BULL_REDIS_HOST:
                    default: ${REDIS_HOST}
                    expose: false
                QUEUE_BULL_REDIS_PASSWORD:
                    default: ${REDIS_PASSWORD}
                    expose: false
                QUEUE_BULL_REDIS_PORT:
                    default: ${REDIS_PORT}
                    expose: false
                WEBHOOK_URL:
                    default: ${ZEABUR_WEB_URL}
                    expose: false
            configs: []
          domainKey: PUBLIC_DOMAIN
        - name: Redis
          icon: https://raw.githubusercontent.com/zeabur/service-icons/main/marketplace/redis.svg
          template: PREBUILT_V2
          spec:
            source:
                image: redis/redis-stack-server:latest
            ports:
                - id: database
                  port: 6379
                  type: TCP
            volumes:
                - id: data
                  dir: /data
            instructions:
                - title: Command to connect to your Redis
                  content: redis-cli -h ${PORT_FORWARDED_HOSTNAME} -p ${DATABASE_PORT_FORWARDED_PORT} -a ${REDIS_PASSWORD}
                - title: Redis Connection String
                  content: redis://:${REDIS_PASSWORD}@${PORT_FORWARDED_HOSTNAME}:${DATABASE_PORT_FORWARDED_PORT}
                - title: Redis password
                  content: ${REDIS_PASSWORD}
                - title: Redis host
                  content: ${PORT_FORWARDED_HOSTNAME}
                - title: Redis port
                  content: ${DATABASE_PORT_FORWARDED_PORT}
            env:
                REDIS_ARGS:
                    default: --requirepass ${REDIS_PASSWORD}
                    expose: false
                REDIS_CONNECTION_STRING:
                    default: redis://:${REDIS_PASSWORD}@${REDIS_HOST}:${REDIS_PORT}
                    expose: true
                REDIS_HOST:
                    default: ${CONTAINER_HOSTNAME}
                    expose: true
                REDIS_PASSWORD:
                    default: ${PASSWORD}
                    expose: true
                REDIS_PORT:
                    default: ${DATABASE_PORT}
                    expose: true
                REDIS_URI:
                    default: ${REDIS_CONNECTION_STRING}
                    expose: true
            configs: []
        - name: n8n-worker
          icon: https://i.imgur.com/KUcP61Z.png
          template: PREBUILT_V2
          spec:
            source:
                image: docker.io/n8nio/n8n:latest
                command:
                    - /bin/sh
                args:
                    - -c
                    - n8n worker
            volumes:
                - id: data
                  dir: /root/.n8n
            env:
                DB_POSTGRESDB_DATABASE:
                    default: ${POSTGRES_DB}
                    expose: false
                DB_POSTGRESDB_HOST:
                    default: ${POSTGRES_HOST}
                    expose: false
                DB_POSTGRESDB_PASSWORD:
                    default: ${POSTGRES_PASSWORD}
                    expose: false
                DB_POSTGRESDB_PORT:
                    default: ${POSTGRES_PORT}
                    expose: false
                DB_POSTGRESDB_USER:
                    default: ${POSTGRES_USERNAME}
                    expose: false
                DB_TYPE:
                    default: postgresdb
                    expose: false
                EXECUTIONS_MODE:
                    default: queue
                    expose: false
                N8N_ENCRYPTION_KEY:
                    default: ${N8N_SHARED_ENCRYPTION_KEY}
                    expose: false
                N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS:
                    default: "true"
                    expose: false
                N8N_HOST:
                    default: ${ZEABUR_WEB_DOMAIN}
                    expose: false
                N8N_RUNNERS_ENABLED:
                    default: "true"
                    expose: false
                NODE_ENV:
                    default: production
                    expose: false
                OFFLOAD_MANUAL_EXECUTIONS_TO_WORKERS:
                    default: "true"
                    expose: false
                QUEUE_BULL_REDIS_HOST:
                    default: ${REDIS_HOST}
                    expose: false
                QUEUE_BULL_REDIS_PASSWORD:
                    default: ${REDIS_PASSWORD}
                    expose: false
                QUEUE_BULL_REDIS_PORT:
                    default: ${REDIS_PORT}
                    expose: false
                WEBHOOK_URL:
                    default: ${ZEABUR_WEB_URL}
                    expose: false
            configs: []
localization:
    ja-JP:
        description: N8N はワーカーサポートを备えたpowerful なワークフローautomatic プラットフォームです.
        variables:
            - key: PUBLIC_DOMAIN
              type: DOMAIN
              name: Domin
              description: N8N インスタンスに用したいドメインは何ですか?
        readme: |-
            # N8N with Worker 1-Click Template (create by SEAFOODHOLDHAND)

            [![N8N with Worker](https://i.imgur.com/gi4FDrn.png)](https://www.youtube.com/@seafoodholdhand)

            N8N は, different なるサービスをconnection 続してタスクをautomatic するのIt is a strong and powerful automatic automatic filter. The following このテンプレートには contains the following:

            - N8N メインインスタンス for ワークフローmanagement (latest バージョン)
            - N8N ワーカー for バックグラウンドタスク treatment
            - データストレージ用のPostgreSQLデータベース
            - Redis for key management

            When using N8N, the following options are possible:
            - Automated されたワークフローの
            - Hundreds of のサービスへの続
            - データ processing and とタスクのautomation
            - Efficient processing of バックグラウンドジョブの

            ワーカーセットアップにより、automatic タスクのパフォーマンスと信格性が上します.

            Note: このテンプレートは, future interchangeability issues をprevention ぐために, 二つのimportant environmental value をeffectiveness しています:

            - `N8N_RUNNERS_ENABLED=true`: タスクランナーなしでのn8nの実行は non-push奨なっています.のバージョンではタスクランナーがデフォルトでeffectiveになります. The settings and future changes are guaranteed, and the interchangeability is ensured.

            - `OFFLOAD_MANUAL_EXECUTIONS_TO_WORKERS=tru e`: スケーリングモードでのメインインスタンスでの Manual 実行は non-push奨となっています. Future のバージョンでは, manual 実行はワーカーにルーティングされます.このSETは、この変changeに备えるものです.

            Task-runners/

            デプロイ中にissueが発生したoccasionは、Github issue で教えてください.できるlimitりsolvedします：
            [https://github.com/glasschan/seafoodholdhand-zeabur-templates](https://github.com/glasschan/seafoodholdhand-zeabur-templates)
    zh-CN:
        description: N8N is a powerful workflow automation platform with work process support capabilities.
        variables:
            - key: PUBLIC_DOMAIN
              type: DOMAIN
              name: domain name
              description: Which domain do you want to bind N8N to?
        readme: |-
            # N8N with Worker 1-Click Template (create by SEAFOODHOLDHAND)

            [![N8N with Worker](https://i.imgur.com/gi4FDrn.png)](https://www.youtube.com/@seafoodholdhand)

            N8N is a powerful workflow automation platform that helps you connect different services and automate tasks. This template contains:

            - N8N master instance for workflow management (latest version)
            - N8N worker processes are used to handle background tasks
            - PostgreSQL database for data storage
            - Redis for queue management

            With N8N, you can:
            - Create automated workflows
            - Connect to hundreds of services
            - Process data and automate tasks
            - Efficiently handle background tasks

            Worker process settings ensure better performance and reliability of your automated tasks.

            NOTE: This template enables two important environment variables to prevent future compatibility issues:

            - `N8N_RUNNERS_ENABLED=true`: Running n8n without the task executor is deprecated. Task executors will be enabled by default in a future release. This setting ensures compatibility with upcoming changes.

            - `OFFLOAD_MANUAL_EXECUTIONS_TO_WORKERS=true`: Manual execution of workflows on the master instance in scale-out mode has been deprecated. In a future release, manual executions will be handled by workers instead. This setting prepares for this change.

            Learn more about task runners: https://docs.n8n.io/hosting/configuration/task-runners/

            If you encounter any problems during deployment, you can tell me on Github issue and I will try my best to solve it:
            [https://github.com/glasschan/seafoodholdhand-zeabur-templates](https://github.com/glasschan/seafoodholdhand-zeabur-templates)
    zh-TW:
        description: N8N is a powerful workflow automation platform with work process support capabilities.
        variables:
            - key: PUBLIC_DOMAIN
              type: DOMAIN
              name: domain
              description: Which domain do you want to bind N8N to?
        readme: |-
            # N8N with Worker 1-Click Template (create by SEAFOODHOLDHAND)

            [![N8N with Worker](https://i.imgur.com/gi4FDrn.png)](https://www.youtube.com/@seafoodholdhand)

            N8N is a powerful workflow automation platform that helps you connect different services and automate tasks. This template includes:

            - N8N master instance for workflow management (latest version)
            - N8N worker processes background tasks
            - PostgreSQL database for data storage
            - Redis for queue management

            With N8N, you can:
            - Create automated workflows
            - Connect to hundreds of services
            - Process data and automate tasks
            - Efficiently handle background tasks

            Job setup ensures better performance and reliability of your automated tasks.

            NOTE: This template enables two important environment variables to prevent future compatibility issues:

            - `N8N_RUNNERS_ENABLED=true`: Running n8n without the task runner is deprecated. Future versions will enable the task runner by default. This setting ensures compatibility with upcoming changes.

            - `OFFLOAD_MANUAL_EXECUTIONS_TO_WORKERS=true`: Manual execution of workflows on the master instance in scale-out mode has been deprecated. In a future release, manual execution will be handled by workers instead. This setting prepares for this change.

            Learn more about task runners: https://docs.n8n.io/hosting/configuration/task-runners/

            If you encounter any problems during deployment, you can tell me on Github issue and I will try my best to solve it:
            [https://github.com/glasschan/seafoodholdhand-zeabur-templates](https://github.com/glasschan/seafoodholdhand-zeabur-templates)
