Chuyển tới nội dung chính

SME Workflows

Learn how to create automated workflows that orchestrate your AI agents to handle complex, multi-step business processes. Workflows eliminate manual work and ensure consistency across your operations.

What are Workflows?

A workflow is a sequence of automated steps that agents execute to accomplish a business task. Think of it as a recipe that tells your agents exactly what to do, when to do it, and in what order.

Workflow vs Single Agent

Single AgentWorkflow
One taskMultiple coordinated tasks
Simple inquiriesComplex processes
Immediate responseMulti-step execution
Example: Answer FAQExample: Onboard customer (verify → create account → send welcome)

Pre-Built Workflow Templates

FAOS provides ready-to-use workflows for common SME scenarios. Start here before building custom workflows.

Customer Service Workflows

Support Ticket Escalation

Automatically route support tickets based on urgency and complexity.

Trigger: New support ticket created Steps:

  1. Classify ticket urgency (low/medium/high/critical)
  2. Check knowledge base for similar issues
  3. If solution found → Send auto-response
  4. If complex → Escalate to human agent
  5. Create ticket in system
  6. Send confirmation to customer

Use this when: You receive 20+ support tickets per day

Setup:

1. Go to Workflows → Templates
2. Select "Support Ticket Escalation"
3. Configure:
- Connect your ticketing system (Zendesk, Freshdesk, etc.)
- Set escalation rules
- Choose notification channels
4. Activate workflow

Customer Feedback Loop

Collect, analyze, and act on customer feedback automatically.

Trigger: Customer completes interaction Steps:

  1. Wait 1 hour after interaction
  2. Send feedback request
  3. If positive → Thank customer, request review
  4. If negative → Create escalation ticket, notify manager
  5. Log feedback in CRM

Time saved: 2-3 hours per week on manual follow-ups

Sales & Lead Management

Lead Qualification & Routing

Automatically qualify incoming leads and route to the right salesperson.

Trigger: New lead from website/form Steps:

  1. Verify contact information
  2. Enrich lead data (company size, industry, location)
  3. Score lead (hot/warm/cold) based on criteria
  4. If hot lead → Notify sales rep immediately
  5. If warm lead → Add to nurture campaign
  6. If cold lead → Add to long-term follow-up
  7. Create CRM record

ROI: Convert leads 30% faster with instant qualification

Proposal Follow-Up

Never let a proposal go cold with automated follow-ups.

Trigger: Proposal sent to prospect Steps:

  1. Wait 2 days
  2. Send friendly check-in
  3. If no response → Wait 3 more days
  4. Send second follow-up with value reminder
  5. If still no response → Notify sales rep
  6. If response received → Schedule meeting

Operations Workflows

Invoice Collection

Automate invoice reminders and payment follow-up.

Trigger: Invoice becomes overdue Steps:

  1. Send polite payment reminder
  2. Wait 3 days
  3. If unpaid → Send second reminder
  4. Wait 5 days
  5. If still unpaid → Escalate to accounts team
  6. Create task for human review

Result: Reduce days sales outstanding (DSO) by 25%

Employee Onboarding

Streamline new hire onboarding with automation.

Trigger: New employee added to HR system Steps:

  1. Create email account
  2. Add to team collaboration tools
  3. Assign onboarding buddy
  4. Send welcome package
  5. Schedule orientation meetings
  6. Create week 1 task checklist
  7. Send day-before reminder

Creating Custom Workflows

Build your own workflows when templates don't fit your needs.

Workflow Builder Overview

graph LR
A[Trigger] --> B[Step 1]
B --> C{Decision?}
C -->|Yes| D[Step 2A]
C -->|No| E[Step 2B]
D --> F[Complete]
E --> F

Step-by-Step: Build Your First Workflow

Let's create a "New Customer Onboarding" workflow.

Step 1: Define the Trigger

How does the workflow start?

Navigate to WorkflowsCreate New

Choose trigger type:

  • Manual: Start workflow when you click a button
  • Webhook: External system triggers it
  • Schedule: Run on a schedule (daily, weekly)
  • Event: FAOS event triggers it (e.g., new agent message)

For our example, choose Webhook (triggered when Stripe creates a new customer).

Step 2: Add First Agent Step

Click + Add StepAgent Action

Configure:

Step Name: Verify Customer Email
Agent: Customer Service Agent
Action: Send welcome email
Input:
customer_email: {{trigger.customer.email}}
customer_name: {{trigger.customer.name}}
Template: welcome-email

The {{trigger.customer.email}} syntax pulls data from the webhook that triggered the workflow.

Step 3: Add a Conditional Step

Click + Add StepCondition

Configure:

Step Name: Check Plan Type
Condition: {{trigger.customer.plan}} === "premium"
If True: Go to "Premium Onboarding"
If False: Go to "Standard Onboarding"

Step 4: Add Parallel Steps

For premium customers, do multiple things at once:

Click + Add StepParallel

Configure:

Run simultaneously:
- Assign account manager
- Schedule kickoff call
- Send premium resources
Wait for all: Yes

Step 5: Set Workflow Settings

Configure timeout and error handling:

Timeout: 300 seconds
Error Handling: Continue (don't stop entire workflow if one step fails)
Retry Policy:
Max Attempts: 3
Backoff: Exponential (2x)

Step 6: Test the Workflow

Before activating:

  1. Click Test Workflow
  2. Provide sample input data
  3. Watch step-by-step execution
  4. Review results
  5. Adjust as needed

Step 7: Activate

Once tested, click Activate Workflow

The workflow now runs automatically whenever triggered.

Workflow Variables

Use variables to pass data between steps.

Trigger Variables

Access data from the trigger:

VariableDescriptionExample
{{trigger.payload}}Full trigger data{{trigger.payload.customer}}
{{trigger.timestamp}}When triggered{{trigger.timestamp}}
{{trigger.source}}Trigger source{{trigger.source}}

Step Results

Reference previous step outputs:

VariableDescriptionExample
{{step_1.result}}Step 1's output{{step_1.result.verified}}
{{step_1.status}}Step 1's status{{step_1.status}}
{{step_1.duration_ms}}How long step took{{step_1.duration_ms}}

Workflow Metadata

Access workflow information:

VariableDescription
{{workflow.id}}Workflow ID
{{workflow.execution_id}}Current execution ID
{{workflow.started_at}}Execution start time

Advanced Workflow Patterns

Pattern 1: Approval Workflow

For actions requiring human approval:

Steps:
1. Agent processes refund request
2. If amount > $100:
- Pause workflow
- Notify manager
- Wait for approval
3. If approved → Process refund
4. Send confirmation

You'll receive a notification to approve/reject in the dashboard.

Pattern 2: Wait & Retry

For processes with delays (like bank transfers):

Steps:
1. Initiate transfer
2. Wait 1 hour
3. Check transfer status
4. If pending → Wait 30 more minutes, check again
5. If completed → Send confirmation
6. If failed → Notify finance team

Pattern 3: Fan-Out / Fan-In

Process items in parallel, then combine results:

Steps:
1. Receive order with 5 items
2. Parallel: Check inventory for each item
3. Wait for all checks to complete
4. Combine results
5. If all available → Proceed to checkout
6. If any unavailable → Notify customer

Pattern 4: Loop / Batch Processing

Process multiple items one by one:

Steps:
1. Get list of overdue invoices
2. For each invoice:
- Send reminder
- Log action
- Wait 1 second (rate limiting)
3. Generate summary report
4. Email report to finance team

Monitoring Workflows

Workflow Dashboard

Track workflow performance:

MetricWhat It MeansGood Target
Success Rate% of successful completions> 95%
Avg DurationHow long workflows takeVaries by workflow
Error Rate% of failed executions< 5%
Active ExecutionsCurrently runningMonitor for backlogs

Execution History

View all workflow runs:

  1. Go to Workflows → Select workflow
  2. Click Executions tab
  3. See list of all runs with status

Debugging Failed Workflows

When a workflow fails:

  1. Click on the failed execution
  2. See which step failed
  3. View error message
  4. Check step inputs/outputs
  5. Fix the issue
  6. Retry execution

Common issues:

  • Invalid data: Check data format from trigger
  • Agent timeout: Increase timeout or optimize agent
  • Integration error: Check third-party service status
  • Permission error: Verify agent has required permissions

Workflow Best Practices

1. Start Simple

Begin with 3-5 steps. Add complexity gradually.

2. Name Steps Clearly

Bad: "Step 1", "Step 2", "Step 3" Good: "Verify Email", "Create Account", "Send Welcome"

3. Use Error Handling

Always configure what happens if a step fails:

  • Continue to next step?
  • Stop entire workflow?
  • Retry automatically?
  • Notify someone?

4. Test with Real Data

Don't just test with "test@example.com". Use real-world scenarios.

5. Set Appropriate Timeouts

  • Simple API call: 30 seconds
  • Agent processing: 60-120 seconds
  • External approval: Hours or days
  • Batch processing: Minutes to hours

6. Monitor Actively

Check workflow dashboard weekly:

  • Are success rates dropping?
  • Are durations increasing?
  • Are errors spiking?

7. Version Your Workflows

Before making changes:

  1. Duplicate workflow
  2. Name it "v2"
  3. Make changes
  4. Test thoroughly
  5. Activate v2
  6. Keep v1 as backup

Common Workflow Examples

E-commerce Order Fulfillment

Trigger: New order placed
├─ Verify payment
├─ Check inventory
├─ If in stock:
│ ├─ Create shipping label
│ ├─ Notify warehouse
│ └─ Send confirmation to customer
└─ If out of stock:
├─ Notify customer (backorder)
└─ Create restock task

Content Approval Pipeline

Trigger: Content submitted
├─ Run plagiarism check
├─ Check brand guidelines
├─ If passes both:
│ ├─ Notify editor
│ ├─ Wait for approval
│ └─ If approved → Publish
└─ If fails either:
└─ Return to author with feedback

Subscription Renewal

Trigger: 7 days before renewal
├─ Send renewal reminder
├─ Wait 3 days
├─ If payment method expiring:
│ └─ Request payment update
├─ Day of renewal:
│ ├─ Attempt charge
│ ├─ If success → Thank customer
│ └─ If fails → Retry 3x, then notify

Integration with External Systems

Workflows can interact with your existing tools:

Supported Integrations

  • CRM: Salesforce, HubSpot, Pipedrive
  • Email: SendGrid, Mailchimp, Customer.io
  • Payment: Stripe, PayPal
  • Project Management: Jira, Asana, Trello
  • Communication: Slack, Microsoft Teams
  • E-commerce: Shopify, WooCommerce

Connecting an Integration

  1. Go to SettingsIntegrations
  2. Click Connect next to desired service
  3. Authorize FAOS to access your account
  4. Integration becomes available in workflows

Getting Help

Workflow not triggering?

  • Check trigger configuration
  • Verify webhook URL is correct
  • Test trigger manually

Steps executing out of order?

  • Review step dependencies
  • Check conditional logic
  • Ensure sequential steps have next_step_id set

Workflow too slow?

  • Use parallel steps where possible
  • Optimize agent prompts
  • Check for unnecessary wait steps

Next Steps