Workflow System - User Guide
Build powerful automation workflows with AI, data processing, and customer engagement.Table of Contents
- What You Can Build
- Quick Start
- Building Blocks
- Working with Data
- Common Patterns
- Scheduling & Automation
- Best Practices
How to Use Workflows
You don’t need to write code! There are two main ways to create and manage workflows:1. 🤖 Ask the AI Assistant
Simply describe what you want in natural language:2. 🖱️ Use the Visual Workflow Editor
The platform includes a visual workflow editor where you can:- View workflows - See your workflow as a visual flowchart
- Add steps - Click to add new steps to your workflow
- Connect steps - Draw connections between steps
- Configure steps - Edit step settings through a side panel
- Test workflows - Run test executions and see results
- Chat with AI - Get help building your workflow from the AI assistant
- Step types with color-coded icons (Trigger, Action, LLM, Condition, Loop)
- Connections between steps
- Step names and descriptions
- Minimap for navigation
- Real-time validation
What You Can Build
Workflows let you automate complex business processes by connecting simple building blocks. Here are real examples:🤖 AI-Powered Customer Support
Auto-reply to customer conversations:- Detect when a conversation needs a reply
- Generate personalized responses using AI
- Match your brand’s tone of voice
- Create approval records for review
📊 Smart Product Recommendations
Suggest products to customers:- Analyze customer purchase history
- Use AI to find relevant products
- Generate personalized recommendations
- Send via email or save to database
🔍 Customer Health Monitoring
Identify at-risk customers:- Assess customer status (active/churned/at-risk)
- Analyze engagement patterns
- Trigger retention campaigns
- Update customer records automatically
📄 Content Processing
Scan and index website content:- Fetch website pages
- Extract metadata and content
- Upload to knowledge base (RAG)
- Keep content synchronized
🔄 Data Synchronization
Keep systems in sync:- Import customers from external systems
- Sync products and inventory
- Upload documents to search
- Process data in batches
Understanding Workflow Structure
A workflow is a series of steps connected in sequence. Each step does one thing, then passes control to the next step.Visual Flow
Key Concepts
Steps - Individual building blocks- Trigger - How the workflow starts
- Action - Do something (get data, send email, update records)
- LLM - Use AI to analyze or generate content
- Condition - Make decisions and branch
- Loop - Process multiple items
- Each step can go to different next steps based on the outcome
success→ next step when things workerror→ handle failurestrue/false→ branch based on conditionsnext/done→ loop through items
- Start with input data
- Each step can access previous step outputs
- Use variables to reference data:
{{customer.email}},{{product.name}} - Store secrets securely for API keys and passwords
Quick Start
Let’s build your first workflow: Send a welcome email to new customersTell the AI What You Want
What the AI Creates
The AI will build a workflow with 3 steps:Step 1: Trigger
- Type: Manual trigger
- Purpose: Start the workflow when you provide a customer ID
Step 2: Get Customer
- Type: Action (customer.get_by_id)
- Purpose: Fetch customer details
- Input: Customer ID from workflow input
- Output: Customer name, email, and other details
Step 3: Send Email
- Type: Action (email_send)
- Purpose: Send personalized welcome email
- Input: Customer email and name from Step 2
- Output: Email sent confirmation
How It Works
View and Test
After the AI creates it:- View the workflow in the visual editor (see the flowchart)
- Test it with a real customer ID
- Activate it when ready
- Run it manually or on a schedule
Building Blocks
Workflows are built from 5 types of steps. Each step does one thing well.1. 🎯 Trigger - Start Your Workflow
What it does: Defines how the workflow starts When to use: Every workflow needs exactly one trigger as the first step Example:manual- Start manually from UI or APIschedule- Run on a schedule (cron)webhook- Trigger from external systemevent- React to system events
success
2. 🤖 LLM - AI Processing
What it does: Uses AI to analyze data, generate content, or make decisions When to use:- Generate personalized content
- Analyze customer data
- Make intelligent decisions
- Extract information from text
Example: Generate product recommendation
systemPrompt- Define the AI’s role and behavior (required)userPrompt- The specific task or question (optional)temperature- Creativity level: 0 (focused) to 1 (creative)maxTokens- Maximum response lengthoutputFormat-"text"for natural language,"json"for structured datatools- Array of tools the AI can use (e.g.,["customer_get", "product_search"])
- Customer:
customer_get,customer_search,list_customers - Product:
product_get,product_search,list_products - Conversation:
conversation_get,conversation_search - And more…
success, error
3. ⚡ Condition - Make Decisions
What it does: Branch your workflow based on data When to use:- Check if a value meets criteria
- Route based on customer status
- Handle different scenarios
Example: Check if customer is VIP
true, false
4. 🔧 Action - Do Something
What it does: Performs operations like sending emails, updating records, calling APIs, or managing data When to use: Whenever you need to interact with data or external systems Actions are the workhorses of your workflow. Each action type provides specific operations for different parts of your system.Customer Actions
Manage customer data and relationships:- create - Create a new customer
- get_by_id - Get customer details by ID
- query - Search customers with filters (status, source, etc.)
- update - Update customer information
- filter - Advanced filtering with expressions (e.g., “totalSpent > 1000”)
- “Get customer by ID and check their status”
- “Find all active customers who haven’t purchased in 30 days”
- “Update customer status to VIP”
Product Actions
Manage product catalog:- create - Create a new product
- get_by_id - Get product details by ID
- query - Search products with filters (category, status, etc.)
- update - Update product information
- filter - Advanced filtering with expressions
- hydrate_fields - Enrich data with product details
- “Get product details for recommendations”
- “Find all active products in a category”
- “Update product stock levels”
Conversation Actions
Manage customer conversations and messages:- create - Create a new conversation
- get_by_id - Get conversation details
- query - Search conversations (by status, customer, channel)
- query_messages - Get messages in a conversation
- update - Update conversation status or metadata
- create_from_email - Create conversation from email thread
- create_from_sent_email - Create conversation from sent email
- “Find all open conversations”
- “Get conversation history for a customer”
- “Update conversation status to resolved”
Document Actions
Manage documents and files:- create - Create a new document
- get_by_id - Get document details
- query - Search documents
- update - Update document metadata
- generate_signed_url - Get temporary download URL
- “Upload a document for processing”
- “Get signed URL for document download”
- “Query documents by source provider”
Email Provider Actions
Get email configuration:- get_default - Get default email provider settings
- get_imap_credentials - Get IMAP credentials for email sync
- “Get email provider for sending messages”
- “Get IMAP credentials for syncing inbox”
RAG (Knowledge Base) Actions
Upload content to semantic search:- upload_document - Upload a document to knowledge base
- upload_text - Upload text content directly
- “Index customer documents for AI search”
- “Upload product descriptions to knowledge base”
Approval Actions
Manage approval workflows:- create_approval - Create an approval request
- update_approval_status - Approve or reject
- get_approval - Get approval details
- list_pending_approvals - List all pending approvals
- get_approval_history - Get approval history
- “Create approval for AI-generated email”
- “List pending approvals for review”
- “Approve or reject a request”
Integration Actions
Connect to external systems:- Execute any operation from configured integrations (Shopify, Circuly, custom APIs, etc.)
- “Sync orders from Shopify”
- “Get subscription data from Circuly”
- “Call custom ERP API”
Utility Actions
General-purpose operations:- set_variables - Store data for later use in the workflow
- workflow.upload_all_workflows - Upload workflows to knowledge base
- “Store calculated values”
- “Save intermediate results”
success and error ports
5. 🔄 Loop - Process Collections
What it does: Iterate over arrays and process each item When to use:- Send emails to multiple customers
- Process a list of products
- Handle batch operations
- Loop starts with first item
- Executes the
nextstep for that item - That step returns to the loop
- Loop moves to next item
- Repeats until all items processed
- Then goes to
donestep
{{loop.item}}- Current item being processed{{loop.item.propertyName}}- Access properties of current item{{loop.index}}- Current position (starts at 0){{loop.parent.item}}- For nested loops (access outer loop’s item)
next, done, error
Working with Data
Variables and Templating
Use{{variable}} syntax to access data anywhere in your workflow:
Input data:
Using Secrets
Store sensitive data (API keys, passwords) securely:Accessing Nested Data
Common Patterns
Pattern 1: AI-Powered Customer Engagement
Use case: Automatically reply to customer messages with AI What you tell the AI:“Create a workflow that finds open conversations, uses AI to decide if they need a reply, generates a response, and saves it for approval.”Workflow structure:
- Finds up to 10 open conversations
- Loops through each conversation
- AI analyzes if it needs a reply
- If yes, AI generates a professional response
- Saves the response as a draft for human approval
- Continues to next conversation
Pattern 2: Smart Product Recommendations
Use case: Recommend products based on customer behavior What you tell the AI:“Create a workflow that gets a customer’s purchase history, uses AI to recommend 3 relevant products, saves the recommendations, and sends them via email.”Workflow structure:
- Gets customer data
- Fetches their last 20 orders
- AI analyzes purchase patterns and recommends 3 products (can search product catalog)
- Saves recommendations to database
- Sends personalized email with recommendations
Pattern 3: Batch Processing with Loops
Use case: Process multiple items efficiently What you tell the AI:“Create a workflow that finds inactive customers, uses AI to assess their status, and updates their records accordingly.”Workflow structure:
- Finds up to 100 inactive customers
- Loops through each customer
- AI analyzes their data and determines status
- Updates customer record with new status
- Continues to next customer
Pattern 4: Multi-Step AI Conversation
Use case: AI steps that build on each other’s context What you tell the AI:“Create a workflow where AI first analyzes customer data, then based on that analysis, recommends specific actions. The AI should remember the first analysis when making recommendations.”Important: To share context between AI steps, you need to provide a
threadId when starting the workflow.
Workflow structure:
threadId:
- Gets customer data
- AI analyzes the customer (creates analysis in thread)
- AI recommends actions (remembers the analysis from step 2)
- Saves both analysis and recommendations
Pattern 5: Error Handling
Use case: Handle failures gracefully What you tell the AI:“Create a workflow that sends an email to a customer. If it succeeds, mark them as contacted. If it fails, log the error for review.”Workflow structure:
- Gets customer data
- Sends email successfully
- Updates customer record with
emailSent: true
- Gets customer data
- Email fails (invalid address, service down, etc.)
- Logs error details for review
Scheduling & Automation
Run on a Schedule
Use cron expressions to run workflows automatically:0 * * * *- Every hour0 9 * * *- Daily at 9 AM0 9 * * 1- Every Monday at 9 AM*/15 * * * *- Every 15 minutes0 0 1 * *- First day of each month
Trigger from Events
Webhook Triggers
Best Practices
✅ Do’s
1. Keep steps focused
- Each step should do one thing well
- Break complex logic into multiple steps
2. Use descriptive names
3. Handle errors
- Always define
errorports for actions and LLM steps - Log failures for debugging
4. Test with small data first
- Start with 1-5 items in loops
- Scale up after testing
5. Use variables wisely
- Store reusable values in variables
- Keep secrets encrypted
6. Add descriptions
❌ Don’ts
1. Don’t create circular flows
2. Don’t hardcode sensitive data
3. Don’t process huge batches in one workflow
4. Don’t skip error handling
5. Don’t nest loops too deeply
Debugging Tips
View Execution Logs
Common Issues
Issue: “Variable not found”
Issue: “Loop not iterating”
Issue: “AI not using tools”
Issue: “Workflow stuck”
- Check for missing
nextStepsdefinitions - Verify all ports are connected
- Look for condition expressions that never evaluate to true
Next Steps
Ready to build your first workflow? Here’s what to do:- Start Simple - Begin with a basic workflow like “send welcome email”
- Ask the AI - Describe what you want in natural language
- Test It - Run your workflow with test data
- Iterate - Add more steps and complexity as needed
- Explore Examples - Check
examples/workflows/for complete working examples
Need Help?
- Ask the AI Assistant - It can help you build and debug workflows
- Check Execution Logs - See what happened at each step
- Test with Small Data - Start with 1-5 items before scaling up
- Start Simple - Build basic workflows first, then add complexity