Skip to content

Workflows

Workflows are visual automation pipelines that connect multiple actions into executable sequences.

Overview

The workflow editor provides a drag-and-drop interface for building complex automations:

  • 30+ node types for various operations
  • Conditional branching with if/else and switch nodes
  • Loops for iterative processing
  • Error handling with retry logic
  • Execution tracking with status monitoring

Creating a Workflow

Via Dashboard

  1. Navigate to Workflows in the sidebar
  2. Click New Workflow
  3. Drag nodes from the palette
  4. Connect nodes by dragging from output to input handles
  5. Configure each node's properties
  6. Save the workflow

Workflow Structure

json
{
  "id": "workflow-123",
  "name": "Email Notification Flow",
  "description": "Send notifications on events",
  "status": "active",
  "nodes": [
    {
      "id": "trigger-1",
      "type": "trigger",
      "data": { "event": "schedule" }
    },
    {
      "id": "email-1",
      "type": "email",
      "data": {
        "to": "{{contact.email}}",
        "subject": "Update"
      }
    }
  ],
  "edges": [
    { "source": "trigger-1", "target": "email-1" }
  ]
}

Node Types

Triggers

NodeDescription
triggerStart point for workflow execution
webhookHTTP webhook endpoint trigger
scheduleTime-based trigger

Logic

NodeDescription
if-elseConditional branching
switchMulti-way branching
loopIterate over arrays
waitDelay execution
parallelRun branches concurrently

API & HTTP

NodeDescription
http-requestMake HTTP requests
webhook-responseRespond to webhooks
graphqlGraphQL queries

Communication

NodeDescription
emailSend emails
telegramTelegram messages
slackSlack messages
discordDiscord messages
whatsappWhatsApp messages
smsSMS messages

Browser Automation

NodeDescription
navigateGo to URL
clickClick element
typeEnter text
extractExtract content
screenshotCapture screenshot
scrollScroll page

AI & LLM

NodeDescription
chatAI conversation
promptSingle prompt completion
tool-callInvoke agent tools
embeddingsGenerate embeddings

Data Operations

NodeDescription
database-querySQL queries
transformData transformation
filterFilter arrays
aggregateAggregate data
file-readRead files
file-writeWrite files

Social Media

NodeDescription
tweetPost to Twitter/X
postGeneric social post

Utilities

NodeDescription
codeExecute JavaScript
variableSet/get variables
logLog messages
errorThrow errors

Node Configuration

Each node has configurable properties:

HTTP Request Node

json
{
  "type": "http-request",
  "data": {
    "method": "POST",
    "url": "https://api.example.com/data",
    "headers": {
      "Authorization": "Bearer {{secrets.api_key}}"
    },
    "body": {
      "message": "{{previous.output}}"
    }
  }
}

If-Else Node

json
{
  "type": "if-else",
  "data": {
    "condition": "{{data.status}} === 'active'",
    "trueTarget": "node-a",
    "falseTarget": "node-b"
  }
}

Loop Node

json
{
  "type": "loop",
  "data": {
    "items": "{{data.users}}",
    "itemVariable": "user",
    "body": "email-node"
  }
}

Variables & Expressions

Variable Syntax

Use double curly braces for dynamic values:

{{variable.path}}
{{previous.output}}
{{context.user.email}}
{{secrets.api_key}}

Available Contexts

ContextDescription
previousOutput from previous node
triggerTrigger node data
contextWorkflow context
secretsStored secrets
envEnvironment variables

Expressions

JavaScript expressions are supported:

{{data.items.length > 0}}
{{data.price * 1.1}}
{{data.name.toUpperCase()}}

Execution

Manual Execution

bash
curl -X POST https://your-domain.com/api/agents/{id}/workflows/execute \
  -d '{
    "workflow_id": "workflow-123",
    "input": { "data": "value" }
  }'

Scheduled Execution

Link workflows to schedules:

json
{
  "type": "cron",
  "expression": "0 9 * * *",
  "callback_type": "workflow",
  "callback_id": "workflow-123"
}

Execution Status

StatusDescription
queuedWaiting to start
runningCurrently executing
completeFinished successfully
erroredFailed with error
terminatedManually stopped

Error Handling

Retry Configuration

json
{
  "retry": {
    "attempts": 3,
    "delay": 60,
    "backoff": "exponential"
  }
}

Error Node

Catch and handle errors:

json
{
  "type": "error-handler",
  "data": {
    "catchFrom": ["node-1", "node-2"],
    "handler": "error-notification"
  }
}

Best Practices

1. Start Simple

Build incrementally:

  • Start with 2-3 nodes
  • Test frequently
  • Add complexity gradually

2. Use Descriptive Names

Name nodes clearly:

  • fetch-user-data not node-1
  • send-welcome-email not email

3. Handle Errors

Always include error handling:

  • Add error handler nodes
  • Configure retries for flaky operations
  • Log failures for debugging

4. Test Thoroughly

Test each path:

  • Happy path
  • Error conditions
  • Edge cases

5. Monitor Executions

Track workflow performance:

  • Check execution history
  • Monitor duration
  • Review error rates

API Reference

See Workflows API for complete endpoint documentation.

Released under the MIT License.