[feat] Add trigger subscriptions and deliveries#4740
Draft
jp-agenta wants to merge 1 commit into
Draft
Conversation
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>
|
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.