Connect n8n
n8n links Cubrel to other apps in workflows: a chain of nodes that starts with a trigger. You can use n8n's cloud or run it on your own server, which keeps the data in your hands. This page shows the two ways a workflow connects to Cubrel, two examples, and how to adapt them to your own case.
You need the Admin role in Cubrel. The REST API and webhooks are on every plan.
How n8n talks to Cubrel
From Cubrel to n8n
Cubrel tells n8n the moment a record changes, through a webhook:
- In n8n, start a workflow with a Webhook node, HTTP Method
POST. It shows a Test URL and a Production URL. - In Cubrel, go to Workspace > Integrations > Webhooks > New Webhook. Pick the module and events and paste the Test URL for now. Save.
- In n8n, click Listen for test event, then change a record in Cubrel, or use Send test on the webhook's page. n8n now shows the data Cubrel sends.
- To react only to some changes, add an If or Filter node.
eventtells you what happened, likecases.created. For an update,changeslists every changed field with itsfromandtovalue. - When the workflow works, switch it on in n8n and change the URL in Cubrel's webhook to the Production URL.
From n8n to Cubrel
A workflow writes into Cubrel through the REST API:
- In Cubrel, create a token under Workspace > Integrations > API Tokens > New Token, with only what the workflow needs. See API Tokens.
- In n8n, create a credential of the type Header Auth: name
Authorization, valueBearerfollowed by your token. Every workflow can reuse it. - Add an HTTP Request node:
- Method:
POSTto create a record. - URL: your workspace address plus
/api/v1/and the module, such ashttps://yourcompany.cubrel.com/api/v1/tasks. - Authentication: Generic Credential Type, Header Auth, your credential.
- Send Body: on, as JSON, with the record's fields.
- Method:
- Use the field names and values Cubrel expects. Download OpenAPI next to the token lists them; see Downloading the OpenAPI file.
Updating instead of adding twice
If the same record can come in again, use Method PUT and add ?match=email (or another field, like sku) to the URL. Cubrel updates the one record with that value, or creates it when there's none. See Create or update by a field.
Example: an email to a shared inbox becomes a task
Requests that arrive at a shared address, like office@, turn into tasks for the team.
| Step | Setting |
|---|---|
| Trigger | Email Trigger (IMAP), connected to the shared mailbox |
| Cubrel token | Write on Tasks |
| Action | HTTP Request, POST to /api/v1/tasks |
| Body | name from the subject, description from the email text, due_at tomorrow, priority medium |
To answer customers from Cubrel instead, use Inbound Email, which turns emails into support tickets without n8n.
Example: a new support ticket alerts a channel
Support hears about every new ticket in Slack or Microsoft Teams.
| Step | Setting |
|---|---|
| Cubrel webhook | Module Cases (or your ticket module), event Created |
| Filter | data > priority is high or urgent, to alert only on urgent tickets |
| Action | Slack or Microsoft Teams node: New ticket: [case number], [name] |
Adapt it to your case
Every workflow with Cubrel is one of the two patterns above. To build your own, change three things:
| Change | Examples |
|---|---|
| The module | leads, deals, quotes, projects, or any module of yours. The slug is in the module's address in Cubrel. |
| The filter (from Cubrel) | event is deals.updated; changes > sales_stage > to is closed_won |
| The fields (to Cubrel) | Any writable field, custom fields included, listed in the token's OpenAPI file |
Keeping it safe
- Give each workflow its own token with only the modules and actions it needs.
- Keep the Webhook node's URL private. n8n can check Cubrel's signature with a Crypto node; see Checking the signature for what to compare.
- A webhook that keeps failing turns itself off after 10 failures in a row, and its creator is notified. A workflow that's switched off in n8n counts as failing.
In short
| Question | Answer |
|---|---|
| How does n8n hear about changes? | A Cubrel webhook pointing at a Webhook node's Production URL |
| How does n8n write into Cubrel? | An HTTP Request node with a Header Auth credential |
| How do I avoid duplicates? | PUT with ?match=email or another field |
| Where are the field names? | Download OpenAPI next to the token |
| Can it run on my own server? | Yes, n8n can be self-hosted |