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
- Navigate to Workflows in the sidebar
- Click New Workflow
- Drag nodes from the palette
- Connect nodes by dragging from output to input handles
- Configure each node's properties
- 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
| Node | Description |
|---|---|
trigger | Start point for workflow execution |
webhook | HTTP webhook endpoint trigger |
schedule | Time-based trigger |
Logic
| Node | Description |
|---|---|
if-else | Conditional branching |
switch | Multi-way branching |
loop | Iterate over arrays |
wait | Delay execution |
parallel | Run branches concurrently |
API & HTTP
| Node | Description |
|---|---|
http-request | Make HTTP requests |
webhook-response | Respond to webhooks |
graphql | GraphQL queries |
Communication
| Node | Description |
|---|---|
email | Send emails |
telegram | Telegram messages |
slack | Slack messages |
discord | Discord messages |
whatsapp | WhatsApp messages |
sms | SMS messages |
Browser Automation
| Node | Description |
|---|---|
navigate | Go to URL |
click | Click element |
type | Enter text |
extract | Extract content |
screenshot | Capture screenshot |
scroll | Scroll page |
AI & LLM
| Node | Description |
|---|---|
chat | AI conversation |
prompt | Single prompt completion |
tool-call | Invoke agent tools |
embeddings | Generate embeddings |
Data Operations
| Node | Description |
|---|---|
database-query | SQL queries |
transform | Data transformation |
filter | Filter arrays |
aggregate | Aggregate data |
file-read | Read files |
file-write | Write files |
Social Media
| Node | Description |
|---|---|
tweet | Post to Twitter/X |
post | Generic social post |
Utilities
| Node | Description |
|---|---|
code | Execute JavaScript |
variable | Set/get variables |
log | Log messages |
error | Throw 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
| Context | Description |
|---|---|
previous | Output from previous node |
trigger | Trigger node data |
context | Workflow context |
secrets | Stored secrets |
env | Environment 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
| Status | Description |
|---|---|
queued | Waiting to start |
running | Currently executing |
complete | Finished successfully |
errored | Failed with error |
terminated | Manually 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-datanotnode-1send-welcome-emailnotemail
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.