Workflow Examples

Explore common workflow patterns and real-world examples. Learn how to build powerful automation for your applications with these practical examples.

Real-World Examples

These examples show how to combine triggers, actions, and conditions to create useful workflows for common business scenarios.

User Onboarding Workflow

Scenario

Automatically welcome new users and set up their accounts when they register.

Trigger

text
Trigger: Database Record Created
Table: users
Condition: status = 'new'

Actions

text
1. Send Welcome Email
   To: "{{user.email}}"
   Subject: "Welcome to {{app.name}}!"
   Body: "Hi {{user.name}}, welcome to our platform!"

2. Create User Profile
   Table: user_profiles
   Data: {
     "user_id": "{{user.id}}",
     "created_at": "{{now()}}"
   }

3. Show Welcome Message
   Component: Welcome Banner
   Property: visible
   Value: true

4. Set User Status
   Table: users
   Where: id = "{{user.id}}"
   Data: { "status": "active" }

Use Cases

E-commerce

  • • Welcome new customers
  • • Set up shopping preferences
  • • Send discount codes
  • • Create wishlist

SaaS Applications

  • • Create user workspace
  • • Set up default settings
  • • Send getting started guide
  • • Schedule onboarding calls

Order Processing Workflow

Scenario

Automatically process orders when they are placed, including inventory updates and notifications.

Trigger

text
Trigger: Form Submission
Form: Order Form
Condition: order_total > 0

Actions

text
1. Create Order Record
   Table: orders
   Data: {
     "customer_id": "{{form.customer_id}}",
     "total": "{{form.total}}",
     "status": "pending",
     "created_at": "{{now()}}"
   }

2. Update Inventory
   Table: products
   Where: id = "{{form.product_id}}"
   Data: { "stock": "{{stock - form.quantity}}" }

3. Send Order Confirmation
   To: "{{customer.email}}"
   Subject: "Order Confirmation #{{order.id}}"
   Body: "Your order has been received and is being processed."

4. Notify Admin
   To: "admin@store.com"
   Subject: "New Order Received"
   Body: "Order #{{order.id}} for $" + "{{order.total}}"

5. Update Order Status
   Table: orders
   Where: id = "{{order.id}}"
   Data: { "status": "confirmed" }

Advanced Features

Inventory validation before processing
Payment processing integration
Shipping label generation
Customer satisfaction surveys

Data Sync Workflow

Scenario

Synchronize data between your application and external systems on a schedule.

Trigger

text
Trigger: Scheduled
Schedule: Every 30 minutes
Condition: business_hours = true

Actions

text
1. Fetch External Data
   Method: GET
   URL: "https://api.external.com/users"
   Headers: { "Authorization": "Bearer {{api_token}}" }

2. Compare with Local Data
   Query: "SELECT * FROM users WHERE updated_at > '{{last_sync}}'"

3. Update Changed Records
   For each changed record:
   - Update local database
   - Log change in sync_log table

4. Handle New Records
   For each new record:
   - Create local record
   - Send welcome notification

5. Update Sync Timestamp
   Table: sync_settings
   Data: { "last_sync": "{{now()}}" }

Error Handling

Retry failed API calls with exponential backoff
Log sync errors for debugging
Send alerts for critical sync failures
Continue processing other records on individual failures

Notification Workflow

Scenario

Send targeted notifications based on user behavior and system events.

Trigger

text
Trigger: Database Record Updated
Table: user_activity
Condition: last_login < dateSub(now(), '7 days')

Actions

text
1. Check User Preferences
   Query: "SELECT * FROM user_preferences WHERE user_id = '{{user.id}}'"

2. Send Re-engagement Email
   To: "{{user.email}}"
   Subject: "We miss you!"
   Body: "Hi {{user.name}}, we noticed you haven't been active. Here's what's new!"

3. Show In-App Notification
   Component: Notification Banner
   Property: visible
   Value: true
   Message: "Welcome back! Check out our latest features."

4. Update User Activity
   Table: user_activity
   Data: { "re_engagement_sent": "{{now()}}" }

Notification Types

User Engagement

  • • Welcome messages
  • • Re-engagement campaigns
  • • Feature announcements
  • • Achievement notifications

System Alerts

  • • Security notifications
  • • System maintenance alerts
  • • Performance warnings
  • • Error notifications

Form Processing Workflow

Scenario

Process form submissions with validation, data storage, and follow-up actions.

Trigger

text
Trigger: Form Submission
Form: Contact Form
Condition: form.email is valid

Actions

text
1. Validate Form Data
   - Check required fields
   - Validate email format
   - Sanitize input data

2. Save to Database
   Table: contact_submissions
   Data: {
     "name": "{{form.name}}",
     "email": "{{form.email}}",
     "message": "{{form.message}}",
     "submitted_at": "{{now()}}"
   }

3. Send Confirmation
   To: "{{form.email}}"
   Subject: "Thank you for contacting us"
   Body: "We received your message and will respond within 24 hours."

4. Notify Team
   To: "support@company.com"
   Subject: "New Contact Form Submission"
   Body: "New message from {{form.name}} ({{form.email}})"

5. Show Success Message
   Component: Success Message
   Property: visible
   Value: true

Advanced Processing

Spam detection and filtering
Automatic ticket creation
Lead scoring and qualification
Integration with CRM systems

Workflow Best Practices

Start Simple

Begin with basic workflows and gradually add complexity. Test each step thoroughly before adding more actions or conditions.

Error Handling

Always include error handling in your workflows. Plan for failures and provide fallback actions to ensure reliable operation.

Performance

Consider the performance impact of your workflows. Use efficient queries, batch operations when possible, and avoid unnecessary API calls.

Documentation

Document your workflows clearly. Include comments explaining the purpose and logic, especially for complex conditional flows.