Workflow Examples

This page contains practical examples of common workflow patterns. Each example includes the visual layout, node configurations, and expected behavior.

Example 1: Order Confirmation Email

Send a confirmation email when a new order is created.

Visual Layout

┌─────────────────┐     ┌─────────────────┐
│  Order Created  │────►│   Send Email    │
│    (Trigger)    │     │    (Action)     │
└─────────────────┘     └─────────────────┘

Node Configuration

Order Created Trigger:

{
  "node_type": "orders:order-created",
  "config": {}
}

Send Email Action:

{
  "node_type": "workflows:send-email",
  "config": {
    "to": "{{customer.email}}",
    "subject": "Order #{{order.id}} Confirmed",
    "body": "Hi {{customer.name}},\n\nThank you for your order!\n\nOrder Total: ${{order.total}}\n\nWe'll notify you when it ships.",
    "bodyType": "text"
  }
}

API Creation

curl -X POST https://api.example.com/api/v1/workflows \
  -H "Authorization: Bearer TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Order Confirmation Email",
    "description": "Send confirmation email when order is created",
    "trigger_type": "event",
    "nodes": [
      {
        "node_type": "orders:order-created",
        "node_category": "trigger",
        "label": "Order Created",
        "config": {},
        "position": { "x": 100, "y": 150 }
      },
      {
        "node_type": "workflows:send-email",
        "node_category": "action",
        "label": "Send Confirmation",
        "config": {
          "to": "{{customer.email}}",
          "subject": "Order #{{order.id}} Confirmed",
          "body": "Thank you for your order!"
        },
        "position": { "x": 400, "y": 150 }
      }
    ],
    "connections": [
      {
        "source_node_index": 0,
        "target_node_index": 1
      }
    ]
  }'

Example 2: High-Value Order Alert

Alert the sales team when an order above $500 is placed.

Visual Layout

┌─────────────────┐     ┌─────────────────┐     ┌─────────────────┐
│  Order Created  │────►│    If/Else      │────►│   Send Email    │
│    (Trigger)    │     │  (Condition)    │     │  (to Sales)     │
└─────────────────┘     └────────┬────────┘     └─────────────────┘
                                 │ false
                                 ▼
                        (no action - end)

Node Configuration

If/Else Condition:

{
  "node_type": "workflows:if-else",
  "config": {
    "condition": "{{order.total}} >= 500"
  }
}

Send Email (Sales Alert):

{
  "node_type": "workflows:send-email",
  "config": {
    "to": "sales@company.com",
    "subject": "🎉 High-Value Order: ${{order.total}}",
    "body": "A high-value order has been placed!\n\nCustomer: {{customer.name}}\nEmail: {{customer.email}}\nTotal: ${{order.total}}\n\nOrder ID: {{order.id}}"
  }
}

Connection with Condition Path

{
  "connections": [
    {
      "source_node_id": "if-else-node-id",
      "target_node_id": "send-email-node-id",
      "condition_path": "true"
    }
  ]
}

Example 3: Order Status Update with Customer Notification

Update order status and notify customer via email.

Visual Layout

┌─────────────────┐     ┌─────────────────┐     ┌─────────────────┐
│ Manual Trigger  │────►│  Update Status  │────►│   Send Email    │
│    (Trigger)    │     │    (Action)     │     │    (Action)     │
└─────────────────┘     └─────────────────┘     └─────────────────┘

Node Configuration

Manual Trigger:

{
  "node_type": "workflows:manual-trigger",
  "config": {
    "sampleData": {
      "order_id": "123",
      "new_status": "shipped",
      "customer_email": "customer@example.com"
    }
  }
}

Update Order Status:

{
  "node_type": "orders:update-order-status",
  "config": {
    "orderId": "{{order_id}}",
    "newStatus": "{{new_status}}",
    "notifyCustomer": false
  }
}

Send Email:

{
  "node_type": "workflows:send-email",
  "config": {
    "to": "{{customer_email}}",
    "subject": "Your order has been {{_new_status}}",
    "body": "Great news! Your order status has been updated to: {{_new_status}}"
  }
}

Example 4: Scheduled Daily Report

Send a daily sales summary email at 9 AM.

Visual Layout

┌─────────────────┐     ┌─────────────────┐     ┌─────────────────┐
│Schedule Trigger │────►│  HTTP Request   │────►│   Send Email    │
│  (9 AM daily)   │     │ (Get Sales API) │     │  (Report)       │
└─────────────────┘     └─────────────────┘     └─────────────────┘

Node Configuration

Schedule Trigger:

{
  "node_type": "workflows:schedule-trigger",
  "config": {
    "cron": "0 9 * * *",
    "timezone": "Asia/Kolkata"
  }
}

HTTP Request (Get Sales Data):

{
  "node_type": "workflows:http-request",
  "config": {
    "method": "GET",
    "url": "https://api.example.com/api/v1/reports/daily-sales",
    "headers": {
      "Authorization": "Bearer {{env.INTERNAL_API_KEY}}"
    }
  }
}

Send Email:

{
  "node_type": "workflows:send-email",
  "config": {
    "to": "management@company.com",
    "subject": "Daily Sales Report - {{scheduled_time}}",
    "body": "Daily Sales Summary:\n\nTotal Orders: {{_http_response.total_orders}}\nTotal Revenue: ${{_http_response.total_revenue}}\nTop Product: {{_http_response.top_product}}",
    "bodyType": "text"
  }
}

Example 5: Webhook Integration with Slack

Receive webhook and post to Slack channel.

Visual Layout

┌─────────────────┐     ┌─────────────────┐     ┌─────────────────┐
│Webhook Trigger  │────►│      Map        │────►│  HTTP Request   │
│                 │     │  (Transform)    │     │ (Slack Webhook) │
└─────────────────┘     └─────────────────┘     └─────────────────┘

Node Configuration

Webhook Trigger:

{
  "node_type": "workflows:webhook-trigger",
  "config": {
    "requireSignature": true,
    "signatureHeader": "X-Webhook-Signature",
    "signatureSecret": "your-secret-key"
  }
}

Map Transformer:

{
  "node_type": "workflows:map",
  "config": {
    "mapping": {
      "text": "New event: {{body.event_type}}",
      "channel": "#notifications",
      "username": "Workflow Bot"
    }
  }
}

HTTP Request (Slack):

{
  "node_type": "workflows:http-request",
  "config": {
    "method": "POST",
    "url": "https://hooks.slack.com/services/YOUR/SLACK/WEBHOOK",
    "headers": {
      "Content-Type": "application/json"
    },
    "body": "{\"text\": \"{{text}}\", \"channel\": \"{{channel}}\", \"username\": \"{{username}}\"}",
    "bodyType": "json"
  }
}

Example 6: Multi-Branch Order Processing

Route orders to different processes based on value and customer type.

Visual Layout

                                    ┌─────────────────┐
                           ────────►│   VIP Process   │
                          │ vip     │    (Action)     │
┌─────────────────┐    ┌──┴──────────────┐     └─────────────────┘
│  Order Created  │───►│     Switch      │
│    (Trigger)    │    │   (Customer     │     ┌─────────────────┐
└─────────────────┘    │     Type)       │────►│ Standard Process│
                       └──┬──────────────┘     │    (Action)     │
                          │ new    regular     └─────────────────┘
                          ▼
                  ┌─────────────────┐
                  │ Welcome Process │
                  │    (Action)     │
                  └─────────────────┘

Node Configuration

Switch Condition:

{
  "node_type": "workflows:switch",
  "config": {
    "value": "{{customer.type}}",
    "cases": ["vip", "regular", "new"],
    "defaultCase": "regular"
  }
}

Connections:

{
  "connections": [
    {
      "source_node_id": "switch-node",
      "target_node_id": "vip-process-node",
      "condition_path": "vip"
    },
    {
      "source_node_id": "switch-node",
      "target_node_id": "standard-process-node",
      "condition_path": "regular"
    },
    {
      "source_node_id": "switch-node",
      "target_node_id": "welcome-process-node",
      "condition_path": "new"
    }
  ]
}

Example 7: Delayed Follow-up Sequence

Send follow-up emails with delays.

Visual Layout

┌─────────────────┐     ┌─────────────────┐     ┌─────────────────┐
│  Order Created  │────►│   Send Email    │────►│     Delay       │
│    (Trigger)    │     │ (Confirmation)  │     │   (2 hours)     │
└─────────────────┘     └─────────────────┘     └────────┬────────┘
                                                         │
                                                         ▼
                        ┌─────────────────┐     ┌─────────────────┐
                        │     Delay       │◄────│   Send Email    │
                        │   (24 hours)    │     │   (Thank you)   │
                        └────────┬────────┘     └─────────────────┘
                                 │
                                 ▼
                        ┌─────────────────┐
                        │   Send Email    │
                        │(Review Request) │
                        └─────────────────┘

Node Configuration

Delay (2 hours):

{
  "node_type": "workflows:delay",
  "config": {
    "duration": 2,
    "unit": "hours"
  }
}

Delay (24 hours):

{
  "node_type": "workflows:delay",
  "config": {
    "duration": 24,
    "unit": "hours"
  }
}

Example 8: Data Filtering and Transformation

Filter high-value items and calculate totals.

Visual Layout

┌─────────────────┐     ┌─────────────────┐     ┌─────────────────┐
│  Order Created  │────►│     Filter      │────►│      Map        │
│    (Trigger)    │     │ (High-value)    │     │ (Calculate)     │
└─────────────────┘     └─────────────────┘     └────────┬────────┘
                                                         │
                                                         ▼
                                                ┌─────────────────┐
                                                │   Set Variable  │
                                                │ (Store Result)  │
                                                └─────────────────┘

Node Configuration

Filter (High-value items):

{
  "node_type": "workflows:filter",
  "config": {
    "arrayPath": "items",
    "condition": "{{item.price}} >= 50",
    "outputPath": "premium_items"
  }
}

Map (Calculate total):

{
  "node_type": "workflows:map",
  "config": {
    "mapping": {
      "premium_count": "{{premium_items.length}}",
      "premium_total": "{{premium_items | sum:'price'}}",
      "original_total": "{{order.total}}"
    }
  }
}

Set Variable:

{
  "node_type": "workflows:set-variable",
  "config": {
    "name": "order_analysis",
    "value": {
      "has_premium": "{{premium_count > 0}}",
      "premium_percentage": "{{(premium_total / original_total) * 100}}"
    }
  }
}

Example 9: Error Handling with Retry

HTTP request with retry on failure.

Visual Layout

┌─────────────────┐     ┌─────────────────┐     ┌─────────────────┐
│ Manual Trigger  │────►│  HTTP Request   │────►│   If/Else       │
│                 │     │ (with retry)    │     │ (Check success) │
└─────────────────┘     └─────────────────┘     └────────┬────────┘
                                                         │
                                    success              │
                        ┌───────────────────────────────┘
                        │                               │ failure
                        ▼                               ▼
                ┌─────────────────┐             ┌─────────────────┐
                │   Send Email    │             │   Send Email    │
                │   (Success)     │             │   (Alert)       │
                └─────────────────┘             └─────────────────┘

Node Configuration (with retry settings)

{
  "id": "http-node",
  "node_type": "workflows:http-request",
  "config": {
    "method": "POST",
    "url": "https://external-api.com/endpoint",
    "timeout": 30
  },
  "retry_count": 3,
  "retry_delay_seconds": 60,
  "timeout_seconds": 120
}

Example 10: Complete E-commerce Flow

Full order processing workflow.

Visual Layout

┌─────────────────┐
│  Order Created  │
│    (Trigger)    │
└────────┬────────┘
         │
         ▼
┌─────────────────┐     ┌─────────────────┐
│    If/Else      │────►│ Fraud Check API │
│ (Order > $1000) │     │  (HTTP Request) │
└────────┬────────┘     └────────┬────────┘
         │ < $1000               │
         │                       ▼
         │              ┌─────────────────┐
         │              │    If/Else      │────► Hold Order
         │              │ (Fraud result)  │
         │              └────────┬────────┘
         │                       │ pass
         └───────────┬───────────┘
                     ▼
             ┌─────────────────┐
             │ Update Status   │
             │ (Processing)    │
             └────────┬────────┘
                      │
                      ▼
             ┌─────────────────┐
             │  Send Email     │
             │ (Confirmation)  │
             └────────┬────────┘
                      │
                      ▼
             ┌─────────────────┐
             │ Slack Notify    │
             │ (HTTP Request)  │
             └─────────────────┘

Tips for Building Workflows

Start Simple

Begin with 2-3 nodes and expand once working.

Test Incrementally

Use the Test Run feature after each change.

Use Meaningful Labels

Rename nodes to describe their purpose, not just their type.

Document with Variables

Use Set Variable nodes to track intermediate states.

Handle Edge Cases

Add conditions to handle missing data or errors.

Monitor Executions

Check the execution logs regularly for issues.

Next Steps