Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ComposioHQ/composio/llms.txt
Use this file to discover all available pages before exploring further.
composio.triggers enables your application to react to real-time events from connected third-party services. Subscribe to a live push stream via subscribe(), create persistent trigger instances tied to specific connected accounts via create(), or verify and parse incoming webhook payloads via verify_webhook(). Each event arrives as a TriggerEvent TypedDict with normalized fields regardless of the underlying service.
triggers.subscribe()
Open a real-time WebSocket subscription (backed by Pusher) and receive trigger events as they arrive. Returns a TriggerSubscription that you register callbacks on and then call wait_forever() to keep alive.
Maximum seconds to wait for the WebSocket connection to be established. Defaults to
15.0. Raises ComposioSDKTimeoutError if the connection is not established in time.Returns
ATriggerSubscription object. Register callbacks with its handle() method, then block with wait_forever().
TriggerSubscription.handle()
Register a callback function for incoming trigger events. Accepts keyword filter arguments to scope the callback to specific triggers, toolkits, users, or accounts.
Only invoke this callback for events matching this trigger slug (e.g.
"GMAIL_NEW_GMAIL_MESSAGE").Only invoke this callback for events from this toolkit (e.g.
"gmail").Only invoke this callback for events from this user ID.
Only invoke this callback for events from this specific connected account.
Only invoke this callback for a specific trigger instance ID.
Only invoke this callback for events using a specific auth config.
triggers.create()
Create a persistent trigger instance attached to a connected account. The trigger will fire events whenever the configured condition is met in the external service.
The trigger type slug (e.g.
"GMAIL_NEW_GMAIL_MESSAGE", "GITHUB_COMMIT_EVENT"). Use triggers.list() to discover available slugs.The user ID to create the trigger for. The SDK automatically finds the user’s active connected account for the toolkit. Mutually exclusive with
connected_account_id.Explicitly specify which connected account to attach the trigger to. Takes precedence over
user_id.Trigger-specific configuration parameters (e.g.
{"repo": "my-repo", "owner": "my-org"} for a GitHub trigger). Required for triggers that need configuration.triggers.list()
List available trigger types with optional filters.
Filter to trigger types from specific toolkits (e.g.
["github", "gmail"]).Maximum number of trigger types to return per page.
Pagination cursor for multi-page results.
triggers.list_active()
List active trigger instances (subscriptions already created) with optional filters.
triggers.get_type()
Retrieve a specific trigger type schema by slug. Useful for inspecting required trigger_config fields.
The trigger type slug (e.g.
"GITHUB_COMMIT_EVENT").triggers.verify_webhook()
Verify an incoming webhook payload’s HMAC-SHA256 signature, validate the timestamp, detect the payload version (V1, V2, or V3), and return a normalized TriggerEvent.
The
webhook-id header value from the incoming request (format: msg_xxx).The raw request body as a string.
Your webhook signing secret from the Composio dashboard.
The
webhook-signature header value (format: v1,base64EncodedSignature).The
webhook-timestamp header value (Unix seconds as a string).Maximum allowed age of the webhook in seconds. Default
300 (5 minutes). Set to 0 to disable timestamp validation.WebhookSignatureVerificationError if the signature is invalid or the timestamp is outside tolerance. Raises WebhookPayloadError if the payload cannot be parsed.
TriggerEvent
Every callback receives aTriggerEvent TypedDict with these fields:
The trigger instance ID (
ti_xxx nano-ID).The full UUID of the trigger event.
The external user ID whose connected account fired the event.
The trigger type slug that fired (e.g.
"GMAIL_NEW_GMAIL_MESSAGE").The toolkit slug that owns the trigger (e.g.
"gmail").The normalized event payload. Shape varies per trigger type.
The raw, unprocessed payload from the external service.
Additional metadata including
trigger_config, trigger_data, and connected_account details.