Registers functions and triggers on the iii engine across TypeScript, Python, and Rust. Use when creating workers, registering function handlers, binding triggers, or invoking functions across languages.
83
78%
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Passed
No known issues
Optimize this skill with Tessl
npx tessl skill review --optimize ./skills/iii-functions-and-triggers/SKILL.mdComparable to: Serverless function runtimes, Lambda, Cloud Functions
Use the concepts below when they fit the task. Not every worker needs all of them.
trigger() regardless of language or worker locationschemars::JsonSchema) and Python (via type hints / Pydantic), or manually provided in Node.jsregisterWorker() connects the worker to the engine, registerFunction defines handlers, registerTrigger binds event sources to those handlers, and the engine routes incoming events to the correct function. Functions can invoke other functions across workers and languages via trigger().
| Primitive | Purpose |
|---|---|
registerWorker(url, options?) | Connect worker to engine |
registerFunction(id, handler) | Define a function handler |
registerTrigger({ type, function_id, config, metadata? }) | Bind an event source to a function |
trigger({ function_id, payload }) | Invoke a function synchronously |
trigger({ ..., action: TriggerAction.Void() }) | Fire-and-forget invocation |
trigger({ ..., action: TriggerAction.Enqueue({ queue }) }) | Durable async invocation via queue |
Each reference shows the same patterns (function registration, trigger binding, cross-function invocation) in its respective language.
Code using this pattern commonly includes, when relevant:
registerWorker('ws://localhost:49134', { workerName: 'my-worker' }) — connect to the engineregisterFunction('namespace::name', async (input) => { ... }) — register a handlerregisterTrigger({ type: 'http', function_id, config: { api_path, http_method, middleware_function_ids? } }) — HTTP trigger (with optional middleware)registerTrigger({ type: 'durable:subscriber', function_id, config: { topic } }) — queue triggerregisterTrigger({ type: 'cron', function_id, config: { expression } }) — cron triggerregisterTrigger({ type: 'state', function_id, config: { scope, key } }) — state change triggerregisterTrigger({ type: 'stream', function_id, config: { stream } }) — stream triggerregisterTrigger({ type: 'subscribe', function_id, config: { topic } }) — pubsub subscriberregisterTrigger({ ..., metadata: { owner: 'team', priority: 'high' } }) — optional trigger metadataFunctions can declare their input/output schemas for documentation and discovery:
schemars::JsonSchema on handler input/output types — RegisterFunction::new() auto-generates JSON Schema (Draft 7) from the typeregister_function() auto-extracts JSON Schema (Draft 2020-12)request_format / response_format manually in the registration message (e.g., via Zod's toJSONSchema())Use the adaptations below when they apply to the task.
namespace::name convention for function IDs to group related functionsapi_path and http_method in the trigger configTriggerAction.Enqueue({ queue }) instead of synchronous triggerTriggerAction.Void()iii-http-endpoints.iii-queue-processing.iii-cron-scheduling.iii-trigger-actions.iii-functions-and-triggers when the primary problem is registering functions, binding triggers, or cross-language invocation.iii-functions-and-triggers in the iii engine.8921efa
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.