Builds custom trigger types for events iii does not handle natively. Use when integrating webhooks, file watchers, IoT devices, database CDC, or any external event source.
60
70%
Does it follow best practices?
Impact
—
No eval scenarios have been run
Advisory
Suggest reviewing before use
Optimize this skill with Tessl
npx tessl skill review --optimize ./skills/iii-custom-triggers/SKILL.mdComparable to: Custom event adapters, webhook receivers
Use the concepts below when they fit the task. Not every custom trigger needs all of them.
registerTriggerType({ id, description }, handler) defines a new trigger type with registerTrigger and unregisterTrigger callbacksid, function_id, config, and optional metadataiii.trigger({ function_id, payload: event }) to invoke the registered functionhttp, cron, durable:subscriber, state, stream, subscribeExternal event source (webhook, file watcher, IoT, CDC, etc.)
→ Custom trigger handler (registerTriggerType)
→ iii.trigger({ function_id, payload: event })
→ Registered function processes the event| Primitive | Purpose |
|---|---|
registerTriggerType({ id, description }, handler) | Define a new trigger type with lifecycle hooks |
unregisterTriggerType(id) | Clean up a custom trigger type |
TriggerConfig: { id, function_id, config, metadata? } | Configuration passed to the trigger handler |
iii.trigger({ function_id, payload: event }) | Fire the registered function when the event occurs |
See ../references/custom-triggers.js for the full working example — a custom trigger type that listens for external events and routes them to registered functions.
Also available in Python: ../references/custom-triggers.py
Also available in Rust: ../references/custom-triggers.rs
Code using this pattern commonly includes, when relevant:
registerWorker(url, { workerName }) — worker initializationiii.registerTriggerType({ id, description }, { registerTrigger, unregisterTrigger })iii.register_trigger_type({ "id": id, "description": description }, TriggerHandlerSubclass())iii.register_trigger_type(RegisterTriggerType::new(id, description, handler))registerTrigger(config) / register_trigger(config) is invoked by the engine when a trigger instance is registeredunregisterTrigger(config) / unregister_trigger(config) is invoked when that trigger instance is removediii.trigger({ function_id: config.function_id, payload: eventPayload }) — fire the target functionunregisterTrigger (close connections, remove listeners, clear intervals)const logger = new Logger() — structured loggingconfig.id.registerTrigger, not in module top-level code.unregisterTrigger so deleted triggers do not leak timers or connections.config.iii.trigger().condition_function_id, let the trigger dispatch path evaluate the condition before invoking the target function.trigger_request_format and call_request_format schemas where the SDK supports them, so discovery and generated skills know the config and handler payload shapes.Use the adaptations below when they apply to the task.
file-watcher, mqtt, db-cdc)registerTrigger, start the listener (open socket, receive webhook, subscribe to topic, attach watcher, or consume CDC)unregisterTrigger, tear down the listener to avoid resource leaksconfig.id for clean unregistrationiii.trigger({ function_id, payload: event })iii-http-endpoints.iii-cron-scheduling.iii-queue-processing.iii-custom-triggers when iii has no built-in trigger type for the event source.iii-custom-triggers in the iii engine.a7ebbbb
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.