Workflow Examples
Raccolta di workflow pronti allβuso per scenari comuni.
π Quick Start Examples
Hello World - Il tuo primo workflow
nodes:
- type: trigger
triggerType: manual
label: "Start"
- type: logger
level: info
message: "Hello World!"
label: "Log Message"
Webhook Echo
Riceve dati via webhook e li restituisce.
π Data Processing
CSV Import to Database
Importa un file CSV e inserisce i record nel database.
Configurazione completa
# Parse CSV
- type: transform
operation: custom
expression: |
const lines = trigger.data.content.split('\n');
const headers = lines[0].split(',');
return lines.slice(1).map(line => {
const values = line.split(',');
return headers.reduce((obj, h, i) => {
obj[h.trim()] = values[i]?.trim();
return obj;
}, {});
});
# Validate
- type: transform
operation: filter
condition: |
item.email &&
item.email.includes('@') &&
item.name?.length > 0
# Insert
- type: database
operation: insert
table: "users"
data: "{{split.output.batch}}"
onConflict: update
JSON API to SQL Sync
Sincronizza dati da unβAPI REST a un database SQL.
π Notifications & Alerts
Multi-Channel Alert System
Sistema di alert che invia notifiche su piΓΉ canali in base alla severity.
Condition configuration
type: condition
mode: switch
switchValue: "{{trigger.data.severity}}"
cases:
- value: "critical"
label: "Critical"
- value: "high"
label: "High"
- value: "medium"
label: "Medium"
- default: true
label: "Low"
Daily Report Email
Genera e invia un report giornaliero.
HTML Template
type: transform
operation: custom
expression: |
`
<h1>Daily Report - ${formatDate(new Date(), 'DD/MM/YYYY')}</h1>
<h2>Key Metrics</h2>
<table>
<tr>
<th>Metric</th>
<th>Today</th>
<th>vs Last Week</th>
</tr>
<tr>
<td>Revenue</td>
<td>β¬${metrics.revenue.toFixed(2)}</td>
<td style="color: ${deltas.revenue > 0 ? 'green' : 'red'}">
${deltas.revenue > 0 ? '+' : ''}${deltas.revenue.toFixed(1)}%
</td>
</tr>
<tr>
<td>Orders</td>
<td>${metrics.orders}</td>
<td>${deltas.orders > 0 ? '+' : ''}${deltas.orders.toFixed(1)}%</td>
</tr>
</table>
`
π Security & Compliance
Security Audit Pipeline
Esegue audit di sicurezza completi.
Certificate Expiry Monitor
Monitora la scadenza dei certificati SSL.
π DevOps & CI/CD
Auto-Deploy on Push
Deploy automatico su push a main.
Database Backup
Backup automatico del database.
Terminal commands
# Dump
- type: terminal
command: |
pg_dump -h localhost -U postgres mydb > /backups/mydb_$(date +%Y%m%d_%H%M%S).sql
# Compress
- type: terminal
command: |
gzip /backups/mydb_*.sql
# Cleanup (keep last 7)
- type: terminal
command: |
ls -t /backups/*.gz | tail -n +8 | xargs rm -f
π€ AI & Automation
AI-Powered Support Ticket Router
Classifica e instrada ticket di supporto con AI.
AI Configuration
# Classification
- type: mlInference
provider: openai
model: gpt-4-turbo
input:
messages:
- role: system
content: |
Classify this support ticket into exactly one category:
- billing
- technical
- sales
- other
Also determine urgency (urgent/normal) based on language and issue severity.
Respond in JSON: {"category": "...", "urgency": "...", "confidence": 0.0-1.0}
- role: user
content: "{{trigger.data.subject}}\n\n{{trigger.data.body}}"
Content Moderation Pipeline
Modera contenuti generati dagli utenti.
π Monitoring & Observability
Full Stack Health Check
Monitoring completo dello stack.
Error Rate Alerting
Alert su spike di errori.
π Integration Recipes
Stripe to Slack
Notifica pagamenti Stripe su Slack.
GitHub to Jira
Crea issue Jira da GitHub issues.
Zapier-style Multi-step
Replica un workflow tipico Zapier.
π Templates
Template: Webhook β Process β Notify
nodes:
- id: "1"
type: trigger
triggerType: webhook
path: "/your-endpoint"
- id: "2"
type: transform
operation: custom
expression: |
// Your transformation logic
return { processed: trigger.data };
- id: "3"
type: condition
condition: "{{transform.output.processed != null}}"
- id: "4"
type: notification
channel: slack
message: "Received: {{transform.output.processed}}"
connections:
- from: "1"
to: "2"
- from: "2"
to: "3"
- from: "3"
to: "4"
branch: "true"
Template: Scheduled β Fetch β Store
nodes:
- id: "1"
type: trigger
triggerType: cron
cron: "0 * * * *" # Every hour
- id: "2"
type: api
method: GET
url: "https://api.example.com/data"
- id: "3"
type: transform
operation: map
mappings:
- source: "{{api.data}}"
target: "records"
- id: "4"
type: database
operation: insert
table: "data_snapshots"
data: "{{transform.output.records}}"
π‘ Pro Tips
Error Handling Pattern
Usa sempre un pattern try-catch con condition:
Idempotency Pattern
Garantisci idempotenza con check preliminare:
Circuit Breaker Pattern
Proteggi da servizi in errore:
type: set
variables:
- name: "circuitOpen"
value: |
{{
set.output.failureCount > 5 &&
Date.now() - set.output.lastFailure < 60000
}}