Skip to main content

Running Workflows

Workflows can be triggered manually from the Console, via the API, or on a schedule. All runs are non-blocking — DAEMI returns a run_id immediately and streams results as they arrive.


Manual Run from the Console

  1. Open Workflows in the Console
  2. Click the workflow you want to run
  3. Fill in any required inputs in the Run panel
  4. Click Run Now

The Console opens the live run view showing each step as it executes, with real-time output streaming.


Manual Run via API

POST /api/workflows/{workflow_id}/runs
Content-Type: application/json

{
"inputs": {
"topic": "AI safety",
"email": "kevin@example.com"
}
}

Response (immediate):

{
"run_id": "run_abc123",
"workflow_id": "weekly_research",
"status": "running",
"started_at": "2026-03-08T21:00:00Z"
}

Streaming Results (SSE)

Connect to the SSE stream to receive step-by-step results in real time:

GET /api/workflows/{workflow_id}/runs/{run_id}/stream
Accept: text/event-stream

Each SSE event is a JSON object:

data: {"run_id": "run_abc123", "step": 1, "status": "running", "agent_id": "aria"}

data: {"run_id": "run_abc123", "step": 1, "status": "done", "agent_id": "aria", "response": "Here are the key findings..."}

data: {"run_id": "run_abc123", "status": "complete"}

Run Status

Check the status of a run without streaming:

GET /api/workflows/{workflow_id}/runs/{run_id}
{
"run_id": "run_abc123",
"status": "success",
"steps": [
{ "id": "search", "status": "success", "duration_ms": 1240 },
{ "id": "summarize", "status": "success", "duration_ms": 3800 },
{ "id": "send", "status": "success", "duration_ms": 380 }
],
"started_at": "2026-03-08T21:00:00Z",
"completed_at": "2026-03-08T21:00:05Z",
"duration_ms": 5420
}

Status values: running | success | failed | partial | cancelled


Run History

GET /api/workflows/{workflow_id}/runs?limit=10&sort=recent

The Console also shows run history in the workflow's Runs tab — with per-step durations, outputs, and error details for failed steps.


Handling Failures

When a step fails:

  • The run stops
  • The run status becomes failed
  • The failed step includes an error field with the exception message

Go Deeper