Skip to main content
description: “Build complex agent behaviors with workflows”

Workflows

Workflows let you define complex, multi-step agent behaviors using a visual builder.

Overview

Workflows are composed of:
  • Triggers - What starts the workflow
  • Steps - Individual actions
  • Conditions - Branching logic
  • Actions - API calls, messages, etc.

Creating a Workflow

  1. Go to Dashboard → Workflows
  2. Click New Workflow
  3. Add triggers and steps
  4. Connect them in the visual builder
  5. Save and activate

Trigger Types

TriggerDescription
MessageUser sends a message
ScheduleCron-based scheduling
WebhookHTTP request trigger
EventAgent lifecycle events

Step Types

Call an AI model with custom prompt.
{
  "type": "ai",
  "model": "claude-3-opus",
  "prompt": "Summarize this: {{input}}",
  "output": "summary"
}
Make API calls to external services.
{
  "type": "http",
  "method": "POST",
  "url": "https://api.example.com/data",
  "headers": {
    "Authorization": "Bearer {{api_key}}"
  },
  "body": {
    "message": "{{user_message}}"
  }
}
Send a message to a platform.
{
  "type": "message",
  "platform": "telegram",
  "chat_id": "{{user_id}}",
  "text": "Hello! {{user_name}}"
}
Branch based on conditions.
{
  "type": "condition",
  "expression": "{{sentiment}} == 'positive'",
  "true": "step_positive",
  "false": "step_negative"
}

Example: Customer Support Flow

{
  "name": "Customer Support",
  "trigger": {
    "type": "message",
    "platform": "telegram"
  },
  "steps": [
    {
      "id": "classify",
      "type": "ai",
      "prompt": "Classify this message: {{message}}",
      "output": "category"
    },
    {
      "id": "check_knowledge",
      "type": "condition",
      "expression": "{{category}} in ['billing', 'technical', 'general']"
    },
    {
      "id": "respond",
      "type": "ai",
      "prompt": "Generate a helpful response for: {{message}}"
    }
  ]
}

Variables

Access data throughout your workflow:
// User data
{{user.id}}
{{user.name}}
{{user.email}}

// Message data
{{message.text}}
{{message.platform}}

// Previous step outputs
{{summarize.output}}
{{classify.category}}

// Environment
{{env.API_KEY}}

Scheduling

Run workflows on a schedule:
{
  "trigger": {
    "type": "schedule",
    "cron": "0 9 * * *",  // Daily at 9 AM
    "timezone": "UTC"
  }
}

Best Practices

  1. Keep it simple - Break complex flows into sub-workflows
  2. Add error handling - Use try/catch steps
  3. Test thoroughly - Use the test button before activating
  4. Monitor logs - Check workflow execution logs