Skip to content
Talk to our solutions team

AI Flow

AI Flow (aiflow.svc, service identity ai-flow) is the platform’s flow/pipeline orchestration service. You author flows (DAGs of tasks), submit requests over HTTP, and AI Flow runs them on a fleet of agents — composing the flow engine (the execution engine) and the agent fabric (the agent fabric), with per-tenant persistence in PostgreSQL.

author a flow ──▶ submit a request ──▶ engine plans it ──▶ orchestrator picks an agent
conversation memory + instance/runs persisted ◀── agent runs the task, streams back
ComponentRole
AI Flow (aiflow.svc)HTTP surface, persistence, conversation memory, per-tenant wiring
the flow engineDAG execution engine: parse → plan → dispatch → route; control-flow nodes; retry/timeout; pipelines
the agent fabricgRPC orchestrator↔agent fabric; agent health & capacity; agent selection

1. A flow is a graph of tasks. The node’s kind comes from the key you use:

name: hello
vars: { who: World }
tasks:
- name: build
shell: "echo building..."
next: { go: greet }
- name: greet
print: "Hello, {{who}}!"

2. Run it locally:

Terminal window
kis flow -f hello.yaml -v who=Team

3. Or deploy it as a tenant workflow and call it over HTTP:

Terminal window
curl -X POST https://<host>/workflow/start/sync/response \
-H "Authorization: Bearer $JWT" -H "Content-Type: application/json" \
-d '{"workflowname":"hello","context":{"who":"Team"}}'

4. Add control flow — decisions, parallelism, iteration, human approval:

tasks:
- name: route
choice:
rules:
- condition: "env === 'production'"
next: deploy-prod
default: deploy-dev
- name: build-all
map: { items_path: services, task: build-one, max_concurrency: 4 }
next: { go: gate }
- name: gate
wait:
timeout: 1h
events:
- name: approved
required: [approver]
go: deploy-prod
error: { go: escalate }

Everything above — and more (subworkflows, retries, affinity, selectors, iterators, scripting in JS/Lua) — is covered in [Authoring flows](/blocks/ai/AI Flow/authoring-flows/).

  • Node type is inferred from the keyshell:, choice:, map:, wait: … no nodetype: field.
  • One shared context per run; strings are Liquid ({{var}}), conditions are the platform scripting runtime JS.
  • Selectors (tag, model, gpu, cpu, memory, group) route a task to the right agent; affinity pins across runs.
  • Wait + Signal build human-in-the-loop and event-driven flows.
  • Overflow queue absorbs bursts when agents are busy; work resumes automatically.
  • Multi-tenant (CPET = Customer:Product:Environment:Tenant) with per-tenant PostgreSQL schemas + RLS.

Continue with:

  • [Concepts](/blocks/ai/AI Flow/concepts/) — flows, instances, runs, agents, memory, tenancy: the vocabulary
  • [Authoring flows](/blocks/ai/AI Flow/authoring-flows/) — the complete flow-authoring reference (formats, all node types, routing, templating, iterators, selectors, affinity, retry, scripting, recipes)
  • [HTTP API](/api/AI Flow/) — every endpoint, with request/response shapes
  • [Orchestration](/blocks/ai/AI Flow/orchestration/) — the the agent fabric fabric: wire protocol, agent lifecycle, selection, resilience
  • [Operations](/blocks/ai/AI Flow/operations/) — build, config, deployment, tuning, observability, security