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

CampoTipoObbligatorioDescrizione
labeltextNome identificativo
methodselectMetodo HTTP (GET, POST, PUT, DELETE, PATCH)
urltextURL endpoint (supporta variabili)
headerskeyvalueNoHeaders HTTP
bodyjson/textNoBody della richiesta
contentTypeselectNoContent-Type (json, form, text)
timeoutnumberNoTimeout in ms (default: 30000)
retriesnumberNoTentativi in caso di errore
authobjectNoConfigurazione autenticazione

Tipi di autenticazione

TipoDescrizione
noneNessuna autenticazione
basicHTTP Basic Auth (username/password)
bearerBearer token
apiKeyAPI Key in header o query param
oauth2OAuth 2.0 con refresh token

GET Request

Recupera dati da un’API esterna.

Workflow Esempio: Fetch Dati Meteo

Diagramma di flusso

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

Diagramma di flusso

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

Diagramma di flusso

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

CampoTipoObbligatorioDescrizione
labeltextNome identificativo
n8nUrltextURL istanza n8n
workflowIdtextID workflow da eseguire
apiKeysecretAPI Key n8n
inputDatajsonNoDati da passare al workflow
waitForCompletionbooleanNoAttendi completamento
timeoutnumberNoTimeout in ms

Workflow Esempio: Onboarding Automatico

Diagramma di flusso

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

email

Invia email tramite SMTP o servizi esterni.

Configurazione

CampoTipoObbligatorioDescrizione
labeltextNome identificativo
providerselectProvider email (smtp, sendgrid, ses)
totextDestinatario/i (comma-separated)
subjecttextOggetto email
bodytextCorpo email (supporta HTML e variabili)
fromtextNoMittente
cctextNoCopia conoscenza
attachmentsarrayNoAllegati

Workflow Esempio: Report Giornaliero

Diagramma di flusso

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

CampoTipoObbligatorioDescrizione
labeltextNome identificativo
channelselectCanale notifica
webhookUrltextWebhook URL
messagetextMessaggio (supporta variabili e markdown)
colortextNoColore attachment (hex)
fieldsarrayNoCampi aggiuntivi

Canali supportati

CanaleFormato messaggio
slackSlack Block Kit + Markdown
discordDiscord Embed
teamsAdaptive Cards
telegramMarkdown
webhookJSON custom

Workflow Esempio: Alert Multi-canale

Diagramma di flusso

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

Diagramma di flusso

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

Diagramma di flusso


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
  1. Mai hardcodare API keys nel flow
  2. Usa sempre {{secrets.KEY_NAME}}
  3. Ruota le chiavi regolarmente
  4. Usa scope minimali per OAuth
Error handling
  1. Configura sempre retries per API critiche
  2. Usa condition per gestire errori
  3. Implementa fallback per alta disponibilità
  4. Logga sempre gli errori
Performance
  1. Usa timeout appropriati
  2. Implementa caching dove possibile
  3. Usa batch requests quando supportati
  4. Monitora rate limits