Skip to main content

Overview

Triggers allow functions to be invoked automatically in response to events. The III SDK supports registering triggers and implementing custom trigger types.

Registering Triggers

register_trigger

Register a trigger that automatically invokes a function when an event occurs.
str
required
The trigger type ID (e.g., "http", "cron", "engine::functions-available")
str
required
The function ID to invoke when the trigger fires
Any
required
Trigger-specific configuration (varies by trigger type)
Trigger
Trigger object with unregister() method

Built-in Trigger Types

HTTP Trigger

Exposes a function as an HTTP REST endpoint:
Config Fields:
  • api_path (str): URL path for the endpoint
  • http_method (str): HTTP method ("GET", "POST", "PUT", "PATCH", "DELETE")
  • description (str, optional): Human-readable description

Functions Available Trigger

Invoked when functions become available in the engine:

Custom Trigger Types

register_trigger_type

Register a custom trigger type with a handler that manages trigger lifecycles.
str
required
Unique trigger type ID (e.g., "cron", "webhook")
str
required
Human-readable description of what this trigger type does
TriggerHandler
required
Handler instance implementing register_trigger() and unregister_trigger()

unregister_trigger_type

Unregister a custom trigger type:
str
required
The trigger type ID to unregister

Types

Trigger

Represents a registered trigger instance.

TriggerHandler

Abstract base class for custom trigger type handlers.

TriggerConfig

Configuration passed to trigger handlers.

Example: Webhook Trigger Type

ApiRequest / ApiResponse

Types for HTTP trigger handlers.

ApiRequest

ApiResponse

Example Usage