Workflow configuration reference
This page lists every field and option. The overview shows what it does and a first example.
workflow.yaml is the entry point for a kdeps workflow. It declares metadata, the HTTP server or input source, agent settings, and SQL connections. Resources live in separate files under resources/. Credentials (HTTP auth, search API keys) live in ~/.kdeps/config.yaml or the vault - not here.
How the pieces fit together
Basic structure
# workflow.yaml
apiVersion: kdeps.io/v1
kind: Workflow
metadata:
name: my-agent # required; must be alphanumeric + hyphens
description: My agent # optional
version: "1.0.0" # required; semantic version
targetActionId: response # required; the resource whose output becomes the HTTP response
deploy:
apiServer: { ... } # HTTP REST server settings
webServer: { ... } # static file or app proxy settings
runtime: { ... } # runtime environment (Python, OS packages, LLM backend)
session: { ... } # per-session key-value store: set(k, v, 'session')
repl: { ... } # look of the interactive prompt (prompt, sessionId)Credentials and named connections (HTTP auth, search API keys) belong in ~/.kdeps/config.yaml, not workflow.yaml. deploy: is a closed set. kdeps does not ignore an unknown or removed key (a typo, or the old sqlConnections). kdeps validate fails with Additional property <key> is not allowed. See Global Config for the full reference.
Metadata and config profiles
The workflow's name: under metadata: maps to a per-agent profile in ~/.kdeps/config.yaml. When the workflow runs, kdeps merges that profile on top of global config - only the fields you specify override. Everything else inherits.
# ~/.kdeps/config.yaml
agents:
my-agent: # matches metadata.name: my-agent in workflow.yaml
llm:
backend: openai
openai_api_key: sk-...
defaults:
timezone: America/New_YorkIn an agency, each agent resolves its own profile independently. If no profile matches, kdeps uses the global configuration with no change. On startup, kdeps warns about profiles that do not match any installed workflow name (non-fatal).
Interactive prompt
interactive under deploy.input.sources makes kdeps run a prompt: each line runs the target resource. repl: sets its prompt and sessionId. See Input sources.
API server
apiServer starts an HTTP server. TLS certificate paths go in deploy (not under apiServer).
# workflow.yaml
deploy:
certFile: "/etc/certs/server.crt" # TLS certificate PEM -- omit for plain HTTP
keyFile: "/etc/certs/server.key" # TLS private key PEM
# Or automatic certs for a custom domain (Let's Encrypt):
# letsEncrypt:
# domain: api.example.com
# email: ops@example.com
# See /deploy/tls-https
apiServer:
hostIp: "127.0.0.1" # bind address (default: 127.0.0.1)
portNum: 16395 # port (default: 16395)
trustedProxies:
- "10.0.0.0/8" # IPs/CIDRs whose X-Forwarded-For header is trusted
routes:
- path: /api/v1/chat
methods: [POST] # GET, POST, PUT, PATCH, DELETE, OPTIONS, HEAD
public: true # opt out of API auth for this route - use for endpoints
# called by a browser frontend (it cannot hold a bearer
# token; anything shipped in JS is public anyway)
cors:
allowOrigins:
- http://localhost:16395
# auth token (required): KDEPS_API_AUTH_TOKEN env var or api_auth_token in ~/.kdeps/config.yaml
# routes without public: true require: Authorization: Bearer <token>
rateLimit:
requestsPerMinute: 60 # sustained per-IP rate
burst: 10 # burst allowance above the sustained rate
maxBodyBytes: 1048576 # 1 MB -- excludes multipart file uploads
maxConcurrent: 50 # max in-flight requests; 0 = unlimitedSee Security for the full security reference.
Let's encrypt (custom domain)
deploy:
letsEncrypt:
domain: api.example.com # cert hostname; its A/AAAA record must point here
email: ops@example.com # Let's Encrypt registration email
apiServer:
hostIp: "0.0.0.0" # listen on every interface
portNum: 443 # HTTPS + TLS-ALPN-01; also open port 80 for HTTP-01DNS must point at this host. Open ports 80 and 443. Full guide: TLS and HTTPS. If you set both, static certFile/keyFile have priority.
Web server
webServer serves static files or proxies to a running app process. Use it alongside apiServer to serve a frontend next to your API.
# workflow.yaml
deploy:
webServer:
hostIp: "127.0.0.1"
portNum: 16395
trustedProxies:
- "10.0.0.0/8" # honor X-Forwarded-For from load balancer peers
rateLimit:
requestsPerMinute: 120 # optional; applies even without apiServer
burst: 20
maxBodyBytes: 1048576 # 1 MB -- excludes multipart file uploads
maxConcurrent: 50 # max in-flight requests; 0 = unlimited
routes:
- path: "/"
serverType: "static" # serve files from publicPath
publicPath: "./public"
- path: "/app"
serverType: "app" # proxy to a subprocess on appPort
appPort: 8501
command: "streamlit run app.py"Runtime
runtime controls the runtime environment. These settings affect Docker image builds and local execution.
# workflow.yaml
deploy:
runtime:
timezone: Etc/UTC
pythonVersion: "3.12"
pythonPackages:
- pandas
- requests
osPackages:
- ffmpeg
baseOS: alpine # alpine (default) or ubuntu
installOllama: true # opt-in: bake the ollama server into Docker images (default backend is llamafile, no server)
env:
API_KEY: "value" # environment variables available to all resourcesruntime.env applies everywhere the workflow runs: local kdeps run, Docker images (as ENV directives), ISO services, and Kubernetes manifests. On local runs an already-set process variable always wins, so you can override per invocation: API_KEY=other kdeps run workflow.yaml. This is also how an example pins a backend, e.g. KDEPS_DEFAULT_BACKEND: ollama.
Model selection goes in model: under each resource's chat:. Backend and API keys go in ~/.kdeps/config.yaml. See LLM backends for routing.
SQL connections
The connection string (DSN) lives in ~/.kdeps/config.yaml (machine-local, never committed). The sql component names it with connectionName.
~/.kdeps/config.yaml - DSN (credentials stay here):
sql_connections:
analytics:
connection: "postgres://user:pass@localhost:5432/analytics"
cache:
connection: "sqlite:///path/to/cache.db" # absolute path; sqlite://./cache.db is relative to where kdeps runsThe sql component references a connection by name: connectionName: analytics. The name must match the key in sql_connections in ~/.kdeps/config.yaml.
Supported: PostgreSQL, MySQL/MariaDB, SQLite, SQL Server and Oracle.
Session
Session storage persists values set with set('key', val, 'session') across requests from the same caller.
# workflow.yaml
session:
ttl: "30m" # how long a session lives without activity
type: sqlite # storage backendSee also
- Global config - Backend, defaults, named connections, and agent profiles
- Resources overview - Resource types and fields
- Agencies - Multi-agent orchestration
