Integration Nodes
I nodi di integrazione permettono di connettere il flow editor con servizi esterni, API e sistemi di automazione.
API
api
Effettua chiamate HTTP/HTTPS verso API esterne.
Configurazione
| Campo | Tipo | Obbligatorio | Descrizione |
|---|---|---|---|
label | text | Sì | Nome identificativo |
method | select | Sì | Metodo HTTP (GET, POST, PUT, DELETE, PATCH) |
url | text | Sì | URL endpoint (supporta variabili) |
headers | keyvalue | No | Headers HTTP |
body | json/text | No | Body della richiesta |
contentType | select | No | Content-Type (json, form, text) |
timeout | number | No | Timeout in ms (default: 30000) |
retries | number | No | Tentativi in caso di errore |
auth | object | No | Configurazione autenticazione |
Tipi di autenticazione
| Tipo | Descrizione |
|---|---|
none | Nessuna autenticazione |
basic | HTTP Basic Auth (username/password) |
bearer | Bearer token |
apiKey | API Key in header o query param |
oauth2 | OAuth 2.0 con refresh token |
GET Request
Recupera dati da un’API esterna.
Workflow Esempio: Fetch Dati Meteo
Configurazione
type: api
method: GET
url: "https://api.openweathermap.org/data/2.5/weather"
queryParams:
q: "Milano,IT"
appid: "{{secrets.OPENWEATHER_KEY}}"
units: "metric"
headers:
Accept: "application/json"
timeout: 10000
label: "Fetch Meteo Milano"
Output
{
"status": 200,
"statusText": "OK",
"headers": {
"content-type": "application/json",
"x-ratelimit-remaining": "59"
},
"data": {
"main": {
"temp": 22.5,
"humidity": 65
},
"weather": [
{ "main": "Clouds", "description": "nubi sparse" }
],
"wind": { "speed": 3.5 }
},
"latency": 234
}
POST Request
Invia dati a un’API esterna.
Workflow Esempio: Crea Ticket Jira
Configurazione
type: api
method: POST
url: "https://your-domain.atlassian.net/rest/api/3/issue"
headers:
Content-Type: "application/json"
auth:
type: basic
username: "{{secrets.JIRA_EMAIL}}"
password: "{{secrets.JIRA_TOKEN}}"
body: |
{
"fields": {
"project": { "key": "OPS" },
"summary": "{{trigger.data.title}}",
"description": {
"type": "doc",
"version": 1,
"content": [{
"type": "paragraph",
"content": [{
"type": "text",
"text": "{{trigger.data.description}}"
}]
}]
},
"issuetype": { "name": "Bug" },
"priority": { "name": "{{trigger.data.priority}}" }
}
}
label: "Crea Ticket Jira"
Output
{
"status": 201,
"data": {
"id": "10234",
"key": "OPS-123",
"self": "https://your-domain.atlassian.net/rest/api/3/issue/10234"
},
"latency": 456
}
OAuth2 Authentication
Per API che richiedono OAuth 2.0.
Workflow Esempio: Google Sheets Integration
Configurazione OAuth2
type: api
method: GET
url: "https://sheets.googleapis.com/v4/spreadsheets/{{SHEET_ID}}/values/A1:Z100"
auth:
type: oauth2
clientId: "{{secrets.GOOGLE_CLIENT_ID}}"
clientSecret: "{{secrets.GOOGLE_CLIENT_SECRET}}"
refreshToken: "{{secrets.GOOGLE_REFRESH_TOKEN}}"
tokenUrl: "https://oauth2.googleapis.com/token"
scope: "https://www.googleapis.com/auth/spreadsheets.readonly"
label: "Fetch Google Sheet"
Workflow (n8n)
workflow
Esegue workflow n8n esistenti, permettendo di orchestrare automazioni complesse.
Configurazione
| Campo | Tipo | Obbligatorio | Descrizione |
|---|---|---|---|
label | text | Sì | Nome identificativo |
n8nUrl | text | Sì | URL istanza n8n |
workflowId | text | Sì | ID workflow da eseguire |
apiKey | secret | Sì | API Key n8n |
inputData | json | No | Dati da passare al workflow |
waitForCompletion | boolean | No | Attendi completamento |
timeout | number | No | Timeout in ms |
Workflow Esempio: Onboarding Automatico
Configurazione
type: workflow
n8nUrl: "https://n8n.example.com"
workflowId: "workflow_abc123"
apiKey: "{{secrets.N8N_API_KEY}}"
inputData:
userId: "{{trigger.data.userId}}"
email: "{{trigger.data.email}}"
name: "{{trigger.data.name}}"
waitForCompletion: true
timeout: 60000
label: "n8n Welcome Email"
Output
{
"workflowId": "workflow_abc123",
"executionId": "exec_xyz789",
"status": "success",
"startedAt": "2024-01-15T10:30:00Z",
"finishedAt": "2024-01-15T10:30:05Z",
"data": {
"emailSent": true,
"messageId": "msg_123"
}
}
email
Invia email tramite SMTP o servizi esterni.
Configurazione
| Campo | Tipo | Obbligatorio | Descrizione |
|---|---|---|---|
label | text | Sì | Nome identificativo |
provider | select | Sì | Provider email (smtp, sendgrid, ses) |
to | text | Sì | Destinatario/i (comma-separated) |
subject | text | Sì | Oggetto email |
body | text | Sì | Corpo email (supporta HTML e variabili) |
from | text | No | Mittente |
cc | text | No | Copia conoscenza |
attachments | array | No | Allegati |
Workflow Esempio: Report Giornaliero
Configurazione SMTP
type: email
provider: smtp
smtpHost: "smtp.gmail.com"
smtpPort: 587
smtpUser: "{{secrets.SMTP_USER}}"
smtpPassword: "{{secrets.SMTP_PASS}}"
from: "reports@example.com"
to: "team@example.com"
subject: "Report giornaliero - {{formatDate now 'DD/MM/YYYY'}}"
body: |
<h1>Report {{formatDate now 'DD/MM/YYYY'}}</h1>
<h2>Metriche</h2>
<ul>
<li>Visite: {{transform.data.visits}}</li>
<li>Conversioni: {{transform.data.conversions}}</li>
<li>Revenue: €{{transform.data.revenue}}</li>
</ul>
<p>Report generato automaticamente.</p>
label: "Report Giornaliero"
Output
{
"sent": true,
"messageId": "<abc123@smtp.gmail.com>",
"accepted": ["team@example.com"],
"rejected": [],
"sentAt": "2024-01-15T08:00:05Z"
}
Notification
notification
Invia notifiche su vari canali (Slack, Discord, Teams, Telegram, etc.).
Configurazione
| Campo | Tipo | Obbligatorio | Descrizione |
|---|---|---|---|
label | text | Sì | Nome identificativo |
channel | select | Sì | Canale notifica |
webhookUrl | text | Sì | Webhook URL |
message | text | Sì | Messaggio (supporta variabili e markdown) |
color | text | No | Colore attachment (hex) |
fields | array | No | Campi aggiuntivi |
Canali supportati
| Canale | Formato messaggio |
|---|---|
slack | Slack Block Kit + Markdown |
discord | Discord Embed |
teams | Adaptive Cards |
telegram | Markdown |
webhook | JSON custom |
Workflow Esempio: Alert Multi-canale
Configurazione Slack
type: notification
channel: slack
webhookUrl: "{{secrets.SLACK_WEBHOOK}}"
message: |
🚨 *Incident Alert*
*Servizio:* {{trigger.data.service}}
*Severity:* {{trigger.data.severity}}
*Messaggio:* {{trigger.data.message}}
<{{trigger.data.dashboardUrl}}|Vai alla dashboard>
color: "#FF0000"
fields:
- title: "Ambiente"
value: "{{trigger.data.environment}}"
short: true
- title: "Timestamp"
value: "{{formatDate now 'DD/MM HH:mm'}}"
short: true
label: "Slack Alert"
Configurazione Discord
type: notification
channel: discord
webhookUrl: "{{secrets.DISCORD_WEBHOOK}}"
message: "Incident Alert"
embed:
title: "🚨 {{trigger.data.service}}"
description: "{{trigger.data.message}}"
color: 16711680
fields:
- name: "Severity"
value: "{{trigger.data.severity}}"
inline: true
- name: "Time"
value: "{{formatDate now}}"
inline: true
label: "Discord Alert"
Webhook (Outbound)
Invia dati a webhook esterni in formato custom.
Workflow Esempio: Sync CRM
Configurazione
type: api
method: POST
url: "https://crm.example.com/webhooks/orders"
headers:
Content-Type: "application/json"
X-Webhook-Secret: "{{secrets.CRM_WEBHOOK_SECRET}}"
body: |
{
"event": "order.created",
"timestamp": "{{formatDate now 'ISO'}}",
"data": {
"orderId": "{{trigger.data.id}}",
"customer": {
"email": "{{trigger.data.customer.email}}",
"name": "{{trigger.data.customer.name}}"
},
"amount": {{trigger.data.total}}
}
}
retries: 3
retryDelay: 5000
label: "CRM Webhook"
Retry e Error Handling
Configurazione retry
type: api
method: POST
url: "https://api.example.com/endpoint"
retries: 3
retryDelay: 2000
retryBackoff: exponential # linear, exponential, fixed
retryOn:
- 500
- 502
- 503
- 504
- ECONNREFUSED
- ETIMEDOUT
Workflow con fallback
Rate Limiting
Per API con limiti di richieste.
Configurazione rate limiting
type: api
url: "https://api.example.com/resource"
rateLimit:
maxRequests: 100
perSeconds: 60
queueExcess: true
onLimitReached: delay # delay, error, skip
Best Practices
Gestione secrets
- Mai hardcodare API keys nel flow
- Usa sempre
{{secrets.KEY_NAME}} - Ruota le chiavi regolarmente
- Usa scope minimali per OAuth
Error handling
- Configura sempre retries per API critiche
- Usa condition per gestire errori
- Implementa fallback per alta disponibilità
- Logga sempre gli errori
Performance
- Usa timeout appropriati
- Implementa caching dove possibile
- Usa batch requests quando supportati
- Monitora rate limits