Core Modules

Workflows & Tools

Workflows are LangGraph-powered agent graphs that enable multi-step reasoning, tool calling, and complex decision flows. Assign a workflow to an AI assistant to give it agentic superpowers.

How workflows work

A workflow is a directed graph of nodes. Each node is one of:

input

Entry point — receives the user message

llm

LLM call — runs a prompt with context injection

tool

Tool call — executes a registered tool or REST connection

condition

Router — branches based on output

output

Final response node

Creating a workflow

POST /workflows/
JSON
POST /workflows/
Authorization: Bearer <token>

{
  "name": "Customer Support Flow",
  "description": "Handles support queries with escalation",
  "nodes": [
    { "id": "start", "type": "input" },
    { "id": "classify", "type": "llm", "prompt": "Classify this query..." },
    { "id": "lookup", "type": "tool", "tool": "searchKnowledgeBase" },
    { "id": "respond", "type": "llm", "prompt": "Respond based on..." }
  ],
  "edges": [
    { "from": "start", "to": "classify" },
    { "from": "classify", "to": "lookup" },
    { "from": "lookup", "to": "respond" }
  ]
}

Testing workflows

Test a draft before saving, or test a saved workflow with a specific input:

Test without saving
JSON
POST /workflows/test-draft
Authorization: Bearer <token>

{
  "workflowDraft": { /* workflow definition */ },
  "testInput": "I need help with my order"
}

Tool calls in chat streams

When a workflow node calls a tool, the chat stream emits a tool_call event. Your integration must execute the tool and return the result:

Shell
// When a streaming chat emits a tool_call event:
data: {"type":"tool_call","tool":"searchInventory","args":{"query":"order 1234"},"callId":"tc_abc"}

// Your frontend/backend executes the tool, then submits the result:
POST /tools/result
Authorization: Bearer <token>

{
  "callId": "tc_abc",
  "threadId": "thread_xyz",
  "result": { "items": [{ "id": "ord_1234", "status": "shipped" }] }
}

REST API Connections as tools

Any REST API Connection can be enabled as a tool — the AI assistant will call external APIs as part of its workflow. Configure them at POST /rest-api-connections/ and enable via POST /rest-api-connections/refresh-tools.

Endpoints

MethodEndpointDescription
GET/workflows/List workflows
GET/workflows/:workflowIdGet workflow details
POST/workflows/Create a new workflow
PUT/workflows/:workflowIdUpdate workflow
DELETE/workflows/:workflowIdDelete workflow
POST/workflows/test-draftTest a workflow draft without saving
POST/workflows/:workflowId/duplicateDuplicate a workflow
POST/workflows/:workflowId/testTest a saved workflow
GET/workflows/:workflowId/assignmentsView workflow assignments
POST/workflows/:workflowId/assignAssign workflow to an assistant
DELETE/workflows/assignments/:assignmentIdRemove assignment
GET/workflows/:workflowId/analyticsWorkflow execution analytics
GET/tools/List all registered tools
GET/tools/categoriesTools grouped by category
GET/tools/availableTools available in user context
POST/tools/resultSubmit tool execution result
GET/tools/pending/:threadIdPending tool calls for a thread
PATCH/tools/:name/toggleEnable/disable a tool
Workflows & Tools — CognitionDesk Docs