Using Dolibarr node in the n8n automation platform
- Table of Contents
1. [Connecting to n8n](#Connecting-to-n8n) 2. [Creating a Workflow using Dolibarr Node](#creating-a-workflow-using-dolibarr-node) 3. [Explanation of the different functionnalities](#explanation-of-the-different-functionnalities) 1. [General informations](#general-informations) 1. [Credentials](#credentials) 2. [Fields in every node](#fields-in-every-node) 2. [Creating a Calendar Event](#creating-a-calendar-event) 1. [Creating an event in Calendar when an event is created in Google Calendar](#creating-an-event-in-calendar-when-an-event-is-created-in-google-calendar) 2. [Creating an event in Calendar when an email is received](#creating-an-event-in-calendar-when-an-email-is-received) 3. [Creating a document](#creating-a-document) 1. [Add a document in Dolibarr Document Gestion containing Zoom meeting information](#add-a-document-in-dolibarr-document-gestion-containing-zoom-meeting-information) 4. [Creating a Project Task](#creating-a-project-task) 1. [Creating a Task in Dolibarr when a Github issue is received](#creating-a-task-in-dolibarr-when-a-github-issue-is-received) 4. [Conclusion](#conclusion)
- Connecting to n8n
As explained in previous parts, once you have created your n8n self-hosted instance on your computer and started it with the command : ```bash n8n start ``` or ```bash n8n ``` you just have to press `o` on your terminal to open n8n in your browser.
You should arrive to the following connexion screen where you can enter your connexion informations.

- Creating a Workflow using Dolibarr Node
When you have signed in, you can create you first Workflow and selected the Dolibarr node.
To do that you just have to click on `Add Workflow` to create one and click on the `+` to add a node to your Workflow. It will open a search bar in which you can search `dolibarr` to find it.

- Explanation of the different functionnalities

Here are the different Dolibarr functionnalities we have implemented in n8n.
- General informations
- Credentials
For every Dolibarr node you will have to setup up your credentials in order to connect your Dolibarr instance to n8n.
You can connect to your Dolibarr from the `Credentials` tab or directly from a Dolibarr node.

You have to indicate you base URL which is your instance URL.
And your API key that you can find in your account parameters when connecting in Dolibarr.
- Fields in every node

For every Dolibarr node there will be some fields that will be the same.
These fiels are the first three one on the picture below : - `Credential` to connect with : this is where you can set your `credentials` as explained just before, - `Resource` : this is where you just which module of Dolibarr it will affect, there are 4 options : Calendar, Task, Document and Custom API Call (use this one only if you know what you are doing), - `Operation` : this is in this field where you select this kind of operation you want to do on this specific resource, for now it only support creation operation.
- Creating a Calendar Event
The first node is used to create an event in the calendar in Dolibarr.

If you have selected the `Create an Event` and have alreary set your credentials the first three fields will be already completed.
For the next fields : - `Event Name` corresponds with the `Label` field in Dolibarr interface (this field is required), - `Description` corresponds with the `Descriptio` field (this field is optional), - `Event Type` corresponds with the `Type` type field, three options are available : `Intervention on site`, `Meetings` and `Reception of Email` (this field is required), - `Beginning Date of Event` corresponds with the left date in the `Date` field (this field is required), - `End Date of Event` corresponds with the right date in the `Date` field (this field is required), - `Email From` is not corresponding to any field for now on Dolibarr but since this field is present in Dolibarr AP, it is possible that is the next updates a dedicated Mail Sender field will be available on Dolibarr interface (this field is optional), - `Email Subject` is also not corresponding to ant field for now on Dolibarr and as the the previous one we can expect to the a dedicated field appears is the next updates (this field is optional).
