Complete API reference for creating, managing, and executing multi-agent workflows with MotteAF.
Create a new workflow with nodes, edges, and configuration.
{
"name": "Customer Support Workflow",
"description": "Automated customer inquiry processing",
"version": "1.0",
"nodes": [
{
"id": "classifier",
"type": "llm_agent",
"position": {"x": 100, "y": 100},
"config": {
"model": "gpt-4",
"prompt": "Classify this customer inquiry: {{input}}",
"temperature": 0.1,
"max_tokens": 100
}
},
{
"id": "responder",
"type": "llm_agent",
"position": {"x": 300, "y": 100},
"config": {
"model": "gpt-4",
"prompt": "Generate a helpful response for this {{classifier.category}} inquiry: {{input}}",
"temperature": 0.7,
"max_tokens": 200
}
}
],
"edges": [
{
"id": "edge1",
"from": "classifier",
"to": "responder",
"condition": "classifier.category != 'spam'"
}
],
"settings": {
"timeout": 300,
"retry_attempts": 3,
"parallel_limit": 5
}
}{
"workflow_id": "wf_abc123",
"name": "Customer Support Workflow",
"status": "created",
"version": "1.0",
"created_at": "2024-01-15T10:30:00Z",
"nodes_count": 2,
"edges_count": 1
}Get workflow details, configuration, and current status.
{
"workflow_id": "wf_abc123",
"name": "Customer Support Workflow",
"description": "Automated customer inquiry processing",
"version": "1.0",
"status": "active",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T11:00:00Z",
"nodes": [...],
"edges": [...],
"settings": {
"timeout": 300,
"retry_attempts": 3,
"parallel_limit": 5
},
"execution_stats": {
"total_runs": 145,
"success_rate": 0.94,
"avg_duration": 2.3
}
}Update workflow configuration, nodes, or edges.
{
"name": "Updated Customer Support Workflow",
"description": "Enhanced automated customer inquiry processing",
"nodes": [
{
"id": "classifier",
"type": "llm_agent",
"config": {
"model": "gpt-4",
"prompt": "Classify and prioritize this customer inquiry: {{input}}",
"temperature": 0.1
}
}
],
"settings": {
"timeout": 600,
"retry_attempts": 5
}
}{
"workflow_id": "wf_abc123",
"status": "updated",
"version": "1.1",
"updated_at": "2024-01-15T12:00:00Z",
"changes": [
"Updated classifier prompt",
"Increased timeout to 600s",
"Increased retry attempts to 5"
]
}Delete a workflow and all its execution history.
{
"workflow_id": "wf_abc123",
"status": "deleted",
"message": "Workflow and all execution history deleted successfully"
}Execute a workflow with input data and get results.
{
"workflow_id": "wf_abc123",
"input": {
"message": "I can't access my account and need help resetting my password",
"customer_id": "cust_456",
"priority": "medium"
},
"context": {
"session_id": "sess_789",
"channel": "email"
},
"options": {
"async": false,
"timeout": 300,
"debug": false
}
}{
"execution_id": "exec_def456",
"workflow_id": "wf_abc123",
"status": "completed",
"result": {
"classifier": {
"category": "account_access",
"priority": "high",
"sentiment": "frustrated"
},
"responder": {
"response": "I understand you're having trouble accessing your account. I'll help you reset your password right away. Please check your email for password reset instructions, which should arrive within 5 minutes. If you don't receive the email, please let me know and I can assist you further."
}
},
"execution_time": 2.4,
"tokens_used": 156,
"cost": 0.0023,
"started_at": "2024-01-15T14:30:00Z",
"completed_at": "2024-01-15T14:30:02Z"
}{
"execution_id": "exec_def456",
"workflow_id": "wf_abc123",
"status": "running",
"message": "Workflow execution started",
"started_at": "2024-01-15T14:30:00Z",
"status_url": "/api/workflows/executions/exec_def456"
}Get the status and results of a workflow execution.
{
"execution_id": "exec_def456",
"workflow_id": "wf_abc123",
"status": "completed",
"progress": 1.0,
"current_node": null,
"result": {...},
"execution_trace": [
{
"node_id": "classifier",
"status": "completed",
"started_at": "2024-01-15T14:30:00Z",
"completed_at": "2024-01-15T14:30:01Z",
"input": {...},
"output": {...},
"tokens_used": 45,
"cost": 0.0008
},
{
"node_id": "responder",
"status": "completed",
"started_at": "2024-01-15T14:30:01Z",
"completed_at": "2024-01-15T14:30:02Z",
"input": {...},
"output": {...},
"tokens_used": 111,
"cost": 0.0015
}
],
"total_tokens": 156,
"total_cost": 0.0023,
"execution_time": 2.4
}| Node Type | Purpose | Required Config | Output Format |
|---|---|---|---|
| llm_agent | Generate text responses | model, prompt | string |
| api_call | External API integration | url, method | object |
| condition | Conditional branching | condition | boolean |
| transform | Data transformation | script | any |
| memory_query | Search memory bank | query | array |
| parallel | Parallel execution | branches | object |
The specified workflow ID does not exist or is not accessible.
Workflow execution exceeded the specified timeout limit.
A node in the workflow failed to execute successfully.
The workflow definition contains invalid nodes, edges, or configuration.