Workflow Examples
Learn from practical workflow examples that demonstrate common patterns and best practices. These examples cover various use cases from simple automation to complex AI-powered pipelines.
Example 1: Document Processing Pipeline
Use Case: Automatically extract information from uploaded invoices and store in database.
Workflow Design
Form Trigger (Invoice upload)
→ PDF Parser (Extract text and tables)
→ Entity Extraction (Find invoice details)
→ AI Gateway (Validate and categorize)
→ Conditional (Validation check)
→ [Valid] → MongoDB (Store invoice)
→ Gmail (Send confirmation)
→ [Invalid] → Gmail (Request clarification)
→ API Return (Confirmation)
Configuration Details
Form Trigger:
{
"fields": [
{
"name": "invoice_file",
"type": "file",
"accept": ".pdf",
"maxSize": "10MB",
"required": true
},
{
"name": "customer_email",
"type": "email",
"required": true
}
]
}
PDF Parser:
{
"file": "{{ trigger.formData.invoice_file }}",
"extractTables": true,
"extractText": true
}
Entity Extraction:
{
"text": "{{ pdfParser.text }}",
"entityTypes": [
"INVOICE_NUMBER",
"DATE",
"MONEY",
"ORGANIZATION"
]
}
AI Gateway (Validation):
{
"model": "gpt-4",
"systemPrompt": "Validate invoice data and categorize expense type.",
"userPrompt": `
Invoice Data:
${entityExtraction.entities}
Validate and return JSON:
{
"isValid": boolean,
"category": string,
"confidence": number
}
`,
"temperature": 0.3
}
MongoDB:
{
"action": "insert_one",
"collection": "invoices",
"document": {
"invoiceNumber": "{{ entityExtraction.entities.INVOICE_NUMBER }}",
"date": "{{ entityExtraction.entities.DATE }}",
"amount": "{{ entityExtraction.entities.MONEY }}",
"vendor": "{{ entityExtraction.entities.ORGANIZATION }}",
"category": "{{ aiGateway.category }}",
"uploadedAt": "{{ execution.timestamp }}",
"customerEmail": "{{ trigger.formData.customer_email }}"
}
}
Benefits:
- Automated invoice processing
- AI-powered validation
- Structured data extraction
- Error handling and notifications
Example 2: Customer Support Automation
Use Case: Automatically triage and respond to customer support emails.
Workflow Design
Email Trigger (Support inbox)
→ Email Parser (Extract content)
→ Document Classification (Categorize issue)
→ Conversation Memory (Load customer history)
→ Conditional (Priority routing)
→ [Urgent] → AI Gateway (Immediate response)
→ Gmail (Send response)
→ Slack (Alert team)
→ [Normal] → AI Gateway (Draft response)
→ MongoDB (Queue for review)
→ [FAQ] → Knowledge Base (Find answer)
→ AI Gateway (Format response)
→ Gmail (Auto-respond)
Configuration Details
Document Classification:
{
"text": "{{ emailParser.body }}",
"categories": [
"urgent_bug",
"feature_request",
"billing_question",
"faq",
"other"
],
"multiLabel": false
}
Conversation Memory:
{
"sessionId": "{{ emailParser.from }}",
"operation": "load",
"maxMessages": 5
}
Knowledge Base (FAQ path):
{
"collection": "support_articles",
"query": "{{ emailParser.subject }} {{ emailParser.body }}",
"topK": 3,
"threshold": 0.75
}
AI Gateway (Auto-response):
{
"model": "claude-3-sonnet",
"systemPrompt": "You are a helpful customer support agent. Provide clear, friendly responses.",
"userPrompt": `
Customer Question:
${emailParser.body}
Relevant Article:
${knowledgeBase.results[0].content}
Previous Conversation:
${conversationMemory.history}
Write a helpful response.
`,
"temperature": 0.7
}
Benefits:
- 24/7 automated support
- Intelligent prioritization
- Contextual responses
- Team alerts for urgent issues
Example 3: GitHub Issue Automation
Use Case: Automatically create GitHub issues from form submissions with AI-powered analysis.
Workflow Design
Form Trigger (Bug report)
→ Entity Extraction (Parse bug details)
→ AI Gateway (Analyze severity and categorize)
→ GitHub MCP (Search for duplicates)
→ Conditional (Duplicate check)
→ [Not Duplicate] → GitHub MCP (Create issue)
→ Slack MCP (Notify team)
→ MongoDB (Track submission)
→ [Duplicate] → GitHub MCP (Add comment to existing)
→ Gmail (Notify reporter)
→ API Return (Issue URL)
Configuration Details
Form Trigger:
{
"fields": [
{
"name": "title",
"type": "text",
"required": true
},
{
"name": "description",
"type": "textarea",
"required": true
},
{
"name": "steps_to_reproduce",
"type": "textarea",
"required": true
},
{
"name": "environment",
"type": "select",
"options": ["Production", "Staging", "Development"]
}
]
}
AI Gateway (Analysis):
{
"model": "gpt-4",
"systemPrompt": "Analyze bug reports and determine severity and category.",
"userPrompt": `
Bug Report:
Title: ${trigger.formData.title}
Description: ${trigger.formData.description}
Steps: ${trigger.formData.steps_to_reproduce}
Environment: ${trigger.formData.environment}
Return JSON:
{
"severity": "critical|high|medium|low",
"category": "bug|performance|security|ui|other",
"labels": ["array", "of", "labels"]
}
`,
"responseFormat": "json_object"
}
GitHub MCP (Search):
{
"action": "search_issues",
"repo": "company/product",
"query": "{{ trigger.formData.title }}",
"state": "open",
"limit": 5
}
GitHub MCP (Create Issue):
{
"action": "create_issue",
"repo": "company/product",
"title": "{{ trigger.formData.title }}",
"body": `
## Description
${trigger.formData.description}
## Steps to Reproduce
${trigger.formData.steps_to_reproduce}
## Environment
${trigger.formData.environment}
## Analysis
Severity: ${aiGateway.severity}
Category: ${aiGateway.category}
`,
"labels": "{{ aiGateway.labels }}",
"assignees": "{{ aiGateway.severity === 'critical' ? ['on-call-engineer'] : [] }}"
}
Benefits:
- Automated issue creation
- AI-powered analysis
- Duplicate detection
- Intelligent assignment
Example 4: Daily Report Generation
Use Case: Generate and email daily business metrics report.
Workflow Design
Schedule Trigger (Daily at 8 AM)
→ MongoDB (Fetch yesterday's orders)
→ Loop (Calculate metrics)
→ Map (Transform data)
→ PostgreSQL (Get user analytics)
→ Merge (Combine data sources)
→ AI Gateway (Generate insights)
→ Excel Generator (Create report)
→ Gmail (Send to stakeholders)
→ Amazon S3 (Archive report)
Configuration Details
Schedule Trigger:
Schedule: 0 8 * * 1-5
Timezone: America/New_York
Description: Weekdays at 8 AM
MongoDB:
{
"action": "find",
"collection": "orders",
"filter": {
"createdAt": {
"$gte": "{{ new Date().setDate(new Date().getDate() - 1) }}",
"$lt": "{{ new Date() }}"
}
}
}
Map (Calculate Metrics):
{
"input": "{{ mongoOrders.results }}",
"transform": {
"totalRevenue": "{{ items.reduce((sum, order) => sum + order.amount, 0) }}",
"orderCount": "{{ items.length }}",
"avgOrderValue": "{{ totalRevenue / orderCount }}",
"topProducts": "{{ /* group and sort by product */ }}"
}
}
AI Gateway (Insights):
{
"model": "gpt-4",
"systemPrompt": "Analyze business metrics and provide actionable insights.",
"userPrompt": `
Yesterday's Metrics:
- Revenue: $${metrics.totalRevenue}
- Orders: ${metrics.orderCount}
- Avg Order Value: $${metrics.avgOrderValue}
- Top Products: ${metrics.topProducts}
User Analytics:
${postgresData.analytics}
Provide 3-5 key insights and recommendations.
`,
"temperature": 0.5
}
Gmail:
{
"to": ["team@example.com"],
"subject": "Daily Business Report - {{ new Date().toLocaleDateString() }}",
"body": `
<h1>Daily Report</h1>
<h2>Key Metrics</h2>
<ul>
<li>Revenue: $${metrics.totalRevenue}</li>
<li>Orders: ${metrics.orderCount}</li>
<li>Avg Order: $${metrics.avgOrderValue}</li>
</ul>
<h2>AI Insights</h2>
${aiGateway.insights}
<p>Full report attached.</p>
`,
"attachments": ["{{ excelReport.file }}"]
}
Benefits:
- Automated reporting
- Multi-source data aggregation
- AI-generated insights
- Consistent delivery schedule
Example 5: Content Moderation Pipeline
Use Case: Automatically moderate user-generated content using AI.
Workflow Design
REST API Trigger (Content submission)
→ AI Gateway (Content analysis)
→ Conditional (Moderation result)
→ [Approved] → MongoDB (Publish content)
→ API Return (200 OK)
→ [Flagged] → AI Gateway (Detailed review)
→ Conditional (Severity)
→ [Minor] → MongoDB (Queue for review)
→ [Severe] → MongoDB (Reject)
→ Gmail (Notify user)
→ API Return (202 Pending)
→ [Rejected] → MongoDB (Log rejection)
→ API Return (400 Rejected)
Configuration Details
AI Gateway (Content Analysis):
{
"model": "claude-3-sonnet",
"systemPrompt": `Analyze content for policy violations. Check for:
- Hate speech or harassment
- Violence or threats
- Adult content
- Spam or scams
- Misinformation
`,
"userPrompt": `
Content to analyze:
${trigger.body.content}
Return JSON:
{
"decision": "approved|flagged|rejected",
"violations": ["list of issues"],
"confidence": 0-1,
"explanation": "brief explanation"
}
`,
"responseFormat": "json_object",
"temperature": 0.2
}
AI Gateway (Detailed Review):
{
"model": "gpt-4",
"systemPrompt": "Provide detailed content moderation analysis.",
"userPrompt": `
Content: ${trigger.body.content}
Initial Analysis: ${contentAnalysis.explanation}
Violations: ${contentAnalysis.violations}
Provide:
1. Severity (minor|moderate|severe)
2. Specific policy violations
3. Recommended action
4. User feedback message
`,
"temperature": 0.3
}
Benefits:
- Real-time content moderation
- Multi-tier review process
- Detailed violation tracking
- User feedback
Example 6: E-Commerce Order Processing
Use Case: Process e-commerce orders with payment, inventory, and fulfillment.
Workflow Design
Webhook Trigger (New order)
→ Stripe MCP (Process payment)
→ Conditional (Payment status)
→ [Success] → MongoDB (Update inventory)
→ Conditional (Stock available)
→ [Yes] → Notion MCP (Create fulfillment task)
→ Webflow MCP (Update order status)
→ Gmail (Order confirmation)
→ [No] → MongoDB (Backorder)
→ Gmail (Backorder notification)
→ [Failed] → MongoDB (Log failure)
→ Gmail (Payment failed notification)
Configuration Details
Stripe MCP:
{
"action": "create_payment_intent",
"amount": "{{ trigger.body.amount }}",
"currency": "usd",
"customer": "{{ trigger.body.customerId }}",
"metadata": {
"orderId": "{{ trigger.body.orderId }}",
"items": "{{ trigger.body.items }}"
}
}
MongoDB (Update Inventory):
{
"action": "update_many",
"collection": "products",
"operations": "{{ trigger.body.items.map(item => ({
filter: { _id: item.productId },
update: { $inc: { stock: -item.quantity } }
})) }}"
}
Notion MCP:
{
"action": "create_page",
"database": "fulfillment_queue",
"properties": {
"Order ID": "{{ trigger.body.orderId }}",
"Customer": "{{ trigger.body.customerName }}",
"Items": "{{ trigger.body.items }}",
"Status": "Pending",
"Priority": "{{ trigger.body.shipping === 'express' ? 'High' : 'Normal' }}"
}
}
Benefits:
- Automated payment processing
- Real-time inventory management
- Integrated fulfillment tracking
- Customer notifications
Common Workflow Patterns
Pattern: Event-Driven Integration
External Event (Webhook)
→ Validate & Parse
→ Business Logic
→ Update Systems
→ Notify Stakeholders
Use Cases:
- Payment webhooks
- Git repository events
- Third-party integrations
Pattern: Scheduled Batch Processing
Schedule Trigger
→ Fetch Data (Multiple sources)
→ Merge & Transform
→ Process (Loop/Map)
→ Store Results
→ Generate Report
Use Cases:
- Daily reports
- Data synchronization
- Batch analytics
Pattern: AI Pipeline
Input Trigger
→ Data Preparation
→ AI Model (Analysis/Generation)
→ Validation
→ Post-Processing
→ Output
Use Cases:
- Content generation
- Data extraction
- Sentiment analysis
- Classification
Pattern: Multi-System Orchestration
API Request
→ Fetch from System A
→ Fetch from System B (Parallel)
→ Merge Data
→ Transform
→ Update System C
→ Return Response
Use Cases:
- Microservice orchestration
- Data aggregation
- Cross-system updates
Best Practices from Examples
Error Handling
- Always use Conditional nodes for validation
- Provide user-friendly error messages
- Log failures for debugging
- Implement retry logic for transient failures
Performance
- Use parallel execution where possible (Merge node)
- Batch operations in loops
- Cache frequently accessed data
- Set appropriate timeouts
Security
- Validate all inputs
- Use HMAC for webhooks
- Don't expose sensitive data in responses
- Use Data Sources for credentials
Maintainability
- Use descriptive node names
- Add notes to complex logic
- Version workflows properly
- Document expected data formats
Next Steps
Begin with a simple workflow and gradually add complexity. Test thoroughly at each step before adding more nodes.