Engine Config
Comparable to: infrastructure as code, worker manifests, runtime policy config
Key Concepts
Use the concepts below when they fit the task. Not every deployment needs all workers or adapters.
- config.yaml / iii-config.yaml defines engine workers, modules, adapters, ports, observability, RBAC, and worker manager listeners
- Environment variables use
${VAR:default} syntax (default is optional)
- Workers are the building blocks — each enables a capability (API, state, queue, cron, etc.)
- Managed workers are registry, binary, OCI image, or local workers controlled by the worker manager and
iii worker CLI
- Adapters swap storage and messaging backends: file/KV, Redis, RabbitMQ, local/in-memory where supported
- Queue configs control retry count, concurrency, ordering, and backoff per named queue
- The engine's private worker WebSocket commonly listens on port 49134
- The console commonly runs on 3113, HTTP on 3111, stream WebSocket on 3112, and Prometheus on 9464 when enabled
Architecture
The engine loads YAML config at startup, expands environment variables, initializes modules and built-in daemons, opens configured ports, starts the worker manager, then installs or starts managed workers. SDK workers connect over WebSocket; registry-managed binary and OCI workers can be reproduced from iii.lock.
Runtime Workers and Config Surface
| Worker / Config |
Purpose |
iii-http |
HTTP API server (port 3111) |
iii-stream |
WebSocket streams (port 3112) |
iii-state |
Persistent key-value state storage |
iii-queue |
Background job processing with retries |
iii-pubsub |
In-process event fanout |
iii-cron |
Time-based scheduling |
iii-sandbox |
MicroVM command/filesystem isolation |
shell |
Controlled host/sandbox command and file tools |
iii-directory |
Engine/registry/skills discovery |
iii-observability |
OpenTelemetry traces, metrics, logs |
iii-http-functions |
Outbound HTTP call security |
iii-exec |
Spawn external processes |
iii-bridge |
Distributed cross-engine invocation |
iii-telemetry |
Anonymous product analytics |
iii-worker-manager |
Worker connection lifecycle and RBAC listeners |
iii-worker-ops |
Worker lifecycle operations |
iii (iii-engine-functions runtime) |
Core engine introspection (engine::*) and platform authoring reference |
iii.lock |
Reproducible managed-worker lockfile |
iii worker sync --frozen |
Verify lockfile without mutation |
Code Example
workers:
- name: iii-http
config:
host: 127.0.0.1
port: ${III_HTTP_PORT:3111}
- name: iii-queue
config:
queue_configs:
payments:
max_retries: 5
concurrency: 2
type: fifo
message_group_field: orderId
adapter:
name: builtin
config:
store_method: file_based
file_path: ./data/queue
- name: iii-state
config:
adapter:
name: kv
config:
store_method: file_based
file_path: ./data/state
- name: iii-worker-manager
config:
listeners:
- host: 127.0.0.1
port: 49134
private: true
- host: 0.0.0.0
port: 49135
rbac:
auth_function_id: auth::browser-session
Common Patterns
Code using this pattern commonly includes, when relevant:
iii --config ./config.yaml — start the engine with a config file
docker pull iiidev/iii:latest — pull the Docker image
- Dev storage:
store_method: file_based with file_path: ./data/...
- Prod storage: Redis adapters with
redis_url: ${REDIS_URL}
- Prod queues: RabbitMQ adapter with
amqp_url: ${AMQP_URL} and queue_mode: quorum
- Queue config:
queue_configs with max_retries, concurrency, type, backoff_ms per queue name
- Env var with fallback:
port: ${III_PORT:49134}
- Health check:
curl http://127.0.0.1:3111/health
- Ports: 3111 (API), 3112 (streams), 49134 (engine WS), 9464 (Prometheus)
- RBAC listener: configure
iii-worker-manager with listener host, port, middleware_function_id, and rbac
- HTTP security policy: configure exposed functions, auth function, registration hooks, and forbidden functions on public worker-manager listeners
- Observability: configure OTLP exporter, service name, sampling, metrics, and logs on the observability worker
Worker Config Format
Workers use name: and optional config::
workers:
- name: iii-http
config:
port: 3111
host: 127.0.0.1
- name: iii-state
config:
adapter:
name: kv
config:
store_method: file_based
file_path: ./data/state_store.db
- name: iii-queue
config:
adapter:
name: builtin
config:
store_method: file_based
file_path: ./data/queue_store
- name: iii-stream
config:
port: 3112
host: 127.0.0.1
adapter:
name: kv
config:
store_method: file_based
file_path: ./data/stream_store
- name: iii-cron
config:
adapter:
name: kv
- name: iii-pubsub
config:
adapter:
name: local
- name: iii-observability
config:
enabled: true
service_name: my-service
exporter: memory
sampling_ratio: 1.0
metrics_enabled: true
logs_enabled: true
- name: iii-sandbox
config:
auto_install: true
image_allowlist:
- python
- node
Managed Workers and Lockfiles
- Browse registry workers at
https://workers.iii.dev/.
- Registry workers are installed with
iii worker add NAME[@VERSION].
- Direct OCI workers use image references such as
ghcr.io/org/worker:tag.
- Local workers point at local binary or development paths when supported by the worker config.
iii.lock records resolved binary artifacts or OCI image digests for reproducible installs.
- Commit
iii.lock with config. Use iii worker verify in CI and iii worker sync after cloning.
- Use
iii worker CLI commands for managed-worker lifecycle, lockfile, and verification workflows.
RBAC and Security
- Public worker access should go through an RBAC-enabled
iii-worker-manager listener.
auth_function_id returns allowed and forbidden functions, trigger type permissions, registration permission, registration prefix, and context.
forbidden_functions override exposure filters.
- Discovery is filtered: denied functions should look forbidden, not available.
- Keep RBAC policy examples close to the worker-manager configuration they protect.
Adapting This Pattern
Use the adaptations below when they apply to the task.
- Start with file_based adapters for development, switch to Redis/RabbitMQ for production
- Define queue configs per workload: high-concurrency for parallel jobs, FIFO for ordered processing
- Use environment variables with defaults for all deployment-sensitive values (URLs, ports, credentials)
- Enable only the workers you need — unused workers can be omitted from the config
- Use
iii worker add to add registry-managed workers, then commit both config and iii.lock
- Set
max_retries and backoff_ms based on your failure tolerance and SLA requirements
- Configure the observability worker with your collector endpoint and sampling ratio
- Use
host: 127.0.0.1 instead of host: localhost to avoid IPv4/IPv6 mismatches on macOS
- Keep private worker ports bound to localhost unless a listener has explicit RBAC/security policy
Pattern Boundaries
- For function registration, trigger binding, invocation modes, built-in trigger shapes, custom
triggers, channels, and HTTP-invoked functions, prefer
iii-core-primitives.
- For SDK instrumentation APIs and language-specific package usage, prefer
iii-sdk-reference.
- For complete backend designs that combine queues, state, streams, and pub/sub, prefer
iii-architecture-patterns.
- For worker-backed HTTP, queue, cron, pubsub, state, stream, observability, lifecycle, lockfile, and RBAC behavior, use the matching worker docs under
engine/src/workers/**/skills.
- Stay with
iii-engine-config when the primary problem is configuring or deploying the engine itself.
When to Use
- Use this skill when the task is primarily about
iii-engine-config in the iii engine.
- Triggers when the request directly asks for this pattern or an equivalent implementation.
Boundaries
- Never use this skill as a generic fallback for unrelated tasks.
- You must not apply this skill when a more specific iii skill is a better fit.
- Always verify environment and safety constraints before applying examples from this skill.
1---2name: iii-engine-config3description: Configures the iii engine via iii-config.yaml — workers, adapters, queue configs, ports, and environment variables. Use when deploying, tuning, or customizing the engine.4---5
6# Engine Config
7
8Comparable to: infrastructure as code, worker manifests, runtime policy config
9
10## Key Concepts
11
12Use the concepts below when they fit the task. Not every deployment needs all workers or adapters.
13
14- **config.yaml** / **iii-config.yaml** defines engine workers, modules, adapters, ports, observability, RBAC, and worker manager listeners
15- **Environment variables** use `${VAR:default}` syntax (default is optional)
16- **Workers** are the building blocks — each enables a capability (API, state, queue, cron, etc.)
17- **Managed workers** are registry, binary, OCI image, or local workers controlled by the worker manager and `iii worker` CLI
18- **Adapters** swap storage and messaging backends: file/KV, Redis, RabbitMQ, local/in-memory where supported
19- **Queue configs** control retry count, concurrency, ordering, and backoff per named queue
20- The engine's private worker WebSocket commonly listens on port **49134**
21- The console commonly runs on **3113**, HTTP on **3111**, stream WebSocket on **3112**, and Prometheus on **9464** when enabled
22
23## Architecture
24
25The engine loads YAML config at startup, expands environment variables, initializes modules and built-in daemons, opens configured ports, starts the worker manager, then installs or starts managed workers. SDK workers connect over WebSocket; registry-managed binary and OCI workers can be reproduced from `iii.lock`.
26
27## Runtime Workers and Config Surface
28
29| Worker / Config | Purpose |
30| -------------------------------- | -------------------------------------- |
31| `iii-http` | HTTP API server (port 3111) |
32| `iii-stream` | WebSocket streams (port 3112) |
33| `iii-state` | Persistent key-value state storage |
34| `iii-queue` | Background job processing with retries |
35| `iii-pubsub` | In-process event fanout |
36| `iii-cron` | Time-based scheduling |
37| `iii-sandbox` | MicroVM command/filesystem isolation |
38| `shell` | Controlled host/sandbox command and file tools |
39| `iii-directory` | Engine/registry/skills discovery |
40| `iii-observability` | OpenTelemetry traces, metrics, logs |
41| `iii-http-functions` | Outbound HTTP call security |
42| `iii-exec` | Spawn external processes |
43| `iii-bridge` | Distributed cross-engine invocation |
44| `iii-telemetry` | Anonymous product analytics |
45| `iii-worker-manager` | Worker connection lifecycle and RBAC listeners |
46| `iii-worker-ops` | Worker lifecycle operations |
47| `iii` (`iii-engine-functions` runtime) | Core engine introspection (`engine::*`) and platform authoring reference |
48| `iii.lock` | Reproducible managed-worker lockfile |
49| `iii worker sync --frozen` | Verify lockfile without mutation |
50
51## Code Example
52
53```yaml
54workers:
55 - name: iii-http
56 config:
57 host: 127.0.0.1
58 port: ${III_HTTP_PORT:3111}
59
60 - name: iii-queue
61 config:
62 queue_configs:
63 payments:
64 max_retries: 5
65 concurrency: 2
66 type: fifo
67 message_group_field: orderId
68 adapter:
69 name: builtin
70 config:
71 store_method: file_based
72 file_path: ./data/queue
73
74 - name: iii-state
75 config:
76 adapter:
77 name: kv
78 config:
79 store_method: file_based
80 file_path: ./data/state
81
82 - name: iii-worker-manager
83 config:
84 listeners:
85 - host: 127.0.0.1
86 port: 49134
87 private: true
88 - host: 0.0.0.0
89 port: 49135
90 rbac:
91 auth_function_id: auth::browser-session
92```
93
94## Common Patterns
95
96Code using this pattern commonly includes, when relevant:
97
98- `iii --config ./config.yaml` — start the engine with a config file
99- `docker pull iiidev/iii:latest` — pull the Docker image
100- Dev storage: `store_method: file_based` with `file_path: ./data/...`
101- Prod storage: Redis adapters with `redis_url: ${REDIS_URL}`
102- Prod queues: RabbitMQ adapter with `amqp_url: ${AMQP_URL}` and `queue_mode: quorum`
103- Queue config: `queue_configs` with `max_retries`, `concurrency`, `type`, `backoff_ms` per queue name
104- Env var with fallback: `port: ${III_PORT:49134}`
105- Health check: `curl http://127.0.0.1:3111/health`
106- Ports: 3111 (API), 3112 (streams), 49134 (engine WS), 9464 (Prometheus)
107- RBAC listener: configure `iii-worker-manager` with listener `host`, `port`, `middleware_function_id`, and `rbac`
108- HTTP security policy: configure exposed functions, auth function, registration hooks, and forbidden functions on public worker-manager listeners
109- Observability: configure OTLP exporter, service name, sampling, metrics, and logs on the observability worker
110
111### Worker Config Format
112
113Workers use `name:` and optional `config:`:
114
115```yaml
116workers:
117 - name: iii-http
118 config:
119 port: 3111
120 host: 127.0.0.1
121
122 - name: iii-state
123 config:
124 adapter:
125 name: kv
126 config:
127 store_method: file_based
128 file_path: ./data/state_store.db
129
130 - name: iii-queue
131 config:
132 adapter:
133 name: builtin
134 config:
135 store_method: file_based
136 file_path: ./data/queue_store
137
138 - name: iii-stream
139 config:
140 port: 3112
141 host: 127.0.0.1
142 adapter:
143 name: kv
144 config:
145 store_method: file_based
146 file_path: ./data/stream_store
147
148 - name: iii-cron
149 config:
150 adapter:
151 name: kv
152
153 - name: iii-pubsub
154 config:
155 adapter:
156 name: local
157
158 - name: iii-observability
159 config:
160 enabled: true
161 service_name: my-service
162 exporter: memory
163 sampling_ratio: 1.0
164 metrics_enabled: true
165 logs_enabled: true
166
167 - name: iii-sandbox
168 config:
169 auto_install: true
170 image_allowlist:
171 - python
172 - node
173```
174
175### Managed Workers and Lockfiles
176
177- Browse registry workers at `https://workers.iii.dev/`.
178- Registry workers are installed with `iii worker add NAME[@VERSION]`.
179- Direct OCI workers use image references such as `ghcr.io/org/worker:tag`.
180- Local workers point at local binary or development paths when supported by the worker config.
181- `iii.lock` records resolved binary artifacts or OCI image digests for reproducible installs.
182- Commit `iii.lock` with config. Use `iii worker verify` in CI and `iii worker sync` after cloning.
183- Use `iii worker` CLI commands for managed-worker lifecycle, lockfile, and verification workflows.
184
185### RBAC and Security
186
187- Public worker access should go through an RBAC-enabled `iii-worker-manager` listener.
188- `auth_function_id` returns allowed and forbidden functions, trigger type permissions, registration permission, registration prefix, and context.
189- `forbidden_functions` override exposure filters.
190- Discovery is filtered: denied functions should look forbidden, not available.
191- Keep RBAC policy examples close to the worker-manager configuration they protect.
192
193## Adapting This Pattern
194
195Use the adaptations below when they apply to the task.
196
197- Start with file_based adapters for development, switch to Redis/RabbitMQ for production
198- Define queue configs per workload: high-concurrency for parallel jobs, FIFO for ordered processing
199- Use environment variables with defaults for all deployment-sensitive values (URLs, ports, credentials)
200- Enable only the workers you need — unused workers can be omitted from the config
201- Use `iii worker add` to add registry-managed workers, then commit both config and `iii.lock`
202- Set `max_retries` and `backoff_ms` based on your failure tolerance and SLA requirements
203- Configure the observability worker with your collector endpoint and sampling ratio
204- Use `host: 127.0.0.1` instead of `host: localhost` to avoid IPv4/IPv6 mismatches on macOS
205- Keep private worker ports bound to localhost unless a listener has explicit RBAC/security policy
206
207## Pattern Boundaries
208
209- For function registration, trigger binding, invocation modes, built-in trigger shapes, custom
210 triggers, channels, and HTTP-invoked functions, prefer `iii-core-primitives`.
211- For SDK instrumentation APIs and language-specific package usage, prefer `iii-sdk-reference`.
212- For complete backend designs that combine queues, state, streams, and pub/sub, prefer
213 `iii-architecture-patterns`.
214- For worker-backed HTTP, queue, cron, pubsub, state, stream, observability, lifecycle, lockfile, and RBAC behavior, use the matching worker docs under `engine/src/workers/**/skills`.
215- Stay with `iii-engine-config` when the primary problem is configuring or deploying the engine itself.
216
217## When to Use
218
219- Use this skill when the task is primarily about `iii-engine-config` in the iii engine.
220- Triggers when the request directly asks for this pattern or an equivalent implementation.
221
222## Boundaries
223
224- Never use this skill as a generic fallback for unrelated tasks.
225- You must not apply this skill when a more specific iii skill is a better fit.
226- Always verify environment and safety constraints before applying examples from this skill.