🟥 N8N#

Install#

Warning

The Olvid node for n8n is still in a testing phase. In case of any issues, you can open a ticket on GitHub or send us an email at bot@olvid.io.

Installation of an Olvid daemon and an N8N instance#

In this part, you will deploy an Olvid daemon and an N8N instance using Docker and Docker Compose.

Note

If you wish to use an already deployed instance of Olvid daemon or N8N, you can choose to deploy only some of the following services. But you will need to correctly fill in the OlvidClient Key and Daemon Endpoint fields when creating N8N credentials.

  1. To get started, create a new folder for your project. This will be your current directory going forward.

    mkdir olvid-n8n
    cd olvid-n8n
    
  2. You will then need to generate an administrator client key. You can use the uuidgen or openssl commands depending on your configuration. The result should be stored in a .env file.

    echo "OLVID_ADMIN_KEY=$(uuidgen)" >> .env
    

    OR

    echo "OLVID_ADMIN_KEY=$(openssl rand -hex 32)" >> .env
    
  3. You can now create a docker-compose.yaml file with the following content.

 x-logging: &default-logging
   logging:
     driver: "json-file"
     options:
       max-size: "1m"
       max-file: "100"

 services:
   daemon:
     image: olvid/bot-daemon:1.5.0
     environment:
       - OLVID_ADMIN_CLIENT_KEY_CLI=${OLVID_ADMIN_KEY}
     restart: unless-stopped
     volumes:
       - ./data:/daemon/data
       - ./backups:/daemon/backups
     <<: *default-logging

   cli:
     image: olvid/bot-python-runner:1.5.0
     environment:
       - OLVID_ADMIN_CLIENT_KEY=${OLVID_ADMIN_KEY}
       - OLVID_DAEMON_TARGET=daemon:50051
     stdin_open: true
     tty: true
     entrypoint: "olvid-cli"
     volumes:
       - ./photos:/photos
     depends_on:
       - daemon
     # We use a profile cause cli only need to start on user initiative
     profiles:
       - "cli"
     <<: *default-logging

   n8n:
     image: docker.n8n.io/n8nio/n8n
     restart: always
     ports:
       - "5678:5678"
     environment:
       - N8N_DIAGNOSTICS_ENABLED=false
       - N8N_PUBLIC_API_DISABLED=true
       - N8N_PUBLIC_API_SWAGGERUI_DISABLED=true
       - WEBHOOK_URL=https://n8n.olvid.cloud/
       - NODES_EXCLUDE=["n8n-nodes-base.executeCommand","n8n-nodes-base.readWriteFile"]
       - N8N_REINSTALL_MISSING_PACKAGES=true
     volumes:
       - ./n8n_data:/home/node/.n8n
     entrypoint: sh -c "npm install @olvid/bot-node@0.0.15-alpha && tini -- /docker-entrypoint.sh" #* You can update the version of bot-node here
  1. Start the containers with the following command.

    docker compose up -d daemon n8n
    

Install Olvid nodes in N8N#

You launched an Olvid daemon and a N8N instance that are running in the background, now you need to configure N8N and install the Olvid community nodes.

  1. Open the page http://localhost:5678 in your browser to access your N8N instance.

  2. Create an N8N account (this is a local account).

  3. Go to the settings page

    Settings button on N8N homepage
  4. Click on Community Nodes, then click on Install a community node.

    Community Nodes page in N8N
  5. Enter n8n-nodes-olvid in npm Package Name, take the time to consider the risks of installing a community node before checking the box and clicking on Install.

    Installing Olvid node in N8N
  6. Refresh the page, before going back to the main page to create your first workflow.

Well done 🎉!

The Olvid node should now be available in your workflows.

N8N workflow with an Olvid node available

Configuring the Olvid node#

Now that you have installed the Olvid node, before using it, you need to create credentials for it to be able to communicate with your daemon.

  1. Open or create a workflow, and add an Olvid node to it.

  2. You can independently choose an action or a trigger.

    Trigger selection of Olvid node in N8N
  3. Open your node and create the credentials by clicking on Select Credential.

    Setup of Olvid credentials in N8N
  4. You now need to create an Olvid client key to allow your node to communicate with the Olvid daemon. You can do this by using the following commands in a terminal, within the directory containing your docker-compose.yaml file.

    Prototype: identity new FirstName LastName Position Company

    docker compose run --rm cli identity new Totoro
    

    This command will return an integer that is the identifier of the identity you just created. For subsequent commands, we will consider this identifier to be 1.

  5. Now we need to create an API key for this new identity using the following command.

    Prototype: key new KeyName IdentityId

    docker compose run --rm cli key new totoro-n8n-key 1
    

    This command returns a key in the following form: AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE.

    Copy this key and paste it in the OlvidClient Key field of your Credential creation modal in N8N.

  6. Enter the value for the Daemon Endpoint field to set it as http://daemon:50051 (This is valid only if n8n was created in the same docker-compose.yaml file, otherwise enter the URL that allows you to reach your daemon).

  7. You can now save your credentials with the Save button.

Congratulations 🎉!

You can now start creating your integrated workflows in Olvid!