[feat] Add trigger subscriptions and deliveries#4740
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Adds the two-table subscriptions/deliveries heart of the triggers domain, modeled on webhook_subscriptions/webhook_deliveries. Subscriptions FK the shared gateway_connections row and carry the inputs_fields mapping template; deliveries record resolved inputs/result/error with an event_id dedup column. Subscription CRUD drives the Composio ti_* lifecycle through the adapter; deleting a subscription leaves the shared connection intact. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
b3787e3 to
9b64b43
Compare
5e9e904 to
40de507
Compare
|
Superseded by #4749, which consolidates the entire gateway-triggers work (api + web + hosting + docs) into a single PR. |
Context
With the triggers domain and catalog in place, this lane adds the two-table heart of the feature: subscriptions (a bound provider event plus a workflow to run) and deliveries (the record of each event that arrived). They are modeled directly on the existing
webhook_subscriptionsandwebhook_deliveriestables.Changes
Adds subscription CRUD and delivery reads:
trigger_subscriptionstable: flags (enabled/valid) plus data, the Composioti_*id, thetrigger_config, theinputs_fieldsmapping template, the destination references/selector, the bound workflow ref, and a foreign key to the sharedgateway_connectionsrow. Many subscriptions can share one connection. The tables are domain-prefixed (trigger_*) to avoid colliding with the EE billingsubscriptionstable, matching thewebhook_*naming.trigger_deliveriestable: the resolved inputs, workflow references, result/error, and anevent_iddedup column unique per subscription. The dedup column is the idempotency store; there is no external one./triggers/subscriptions/{,query,{id},{id}/refresh,{id}/revoke}) drive the Composioti_*lifecycle through the adapter. Delivery routes (/triggers/deliveries/{,{id},query}) are read-only.get_subscription_by_trigger_id,write_delivery, anddedup_seen(event_id)for the later ingress lane to consume.Deleting or revoking a subscription touches only the provider
ti_*. It never revokes the shared connection, so other subscriptions and tools on that connection keep working.Mapping is inputs-only for now: the
inputs_fieldstemplate is resolved with the promoted resolver from the WP2 lane. Schema validation of the mapped inputs is left as a follow-up.Tests / notes
COMPOSIO_API_KEY, matching the catalog and connections suites.oss000000003is in the sharedcore_osschain on top of the WP0 rename, so it runs in both editions.