[chore] Mount worker-triggers in all compose stacks#4743
Conversation
… adapter Stand up the inbound triggers domain mirroring tools (action -> event): the read-only events catalog and ComposioTriggersAdapter behind TriggersGatewayInterface (list/get events, create/set-status/delete subscription on ti_* instances). - New core/triggers, apis/fastapi/triggers, dbs/postgres/triggers (skeleton). - Verified Composio v3 REST paths (triggers_types, trigger_instances/...). - Dedicated VIEW_TRIGGERS permission (own triad, viewer default); not VIEW_TOOLS. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Move resolve_payload_fields out of core/webhooks/delivery.py into the SDK as resolve_target_fields (next to resolve_json_selector) so triggers and webhooks share it without a cross-domain import. Pure move + rename, no behavior change; its live consumer today is webhooks. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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>
Inbound dual of webhooks: a global ingress endpoint POST /triggers/composio/events fast-ACKs and enqueues onto the queues:triggers Redis Stream; a dedicated worker_triggers process consumes it and the TriggersDispatcher invokes the bound workflow. - Ingress endpoint with HMAC-SHA256 signature verification against COMPOSIO_WEBHOOK_SECRET; whitelisted in auth middleware as public. - Async pipeline mirroring webhooks: Redis Streams broker + taskiq worker with retry_on_error and TRIGGER_MAX_RETRIES=5; dedup by event_id for idempotency. - Dispatcher attributes the run to the subscription creator (created_by_id) or null; binds the workflow key-agnostically from the references dict via the /retrieve selector shape. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adds a worker-triggers service mirroring worker-webhooks across every OSS and EE compose file so the trigger dispatch worker actually runs: gh/gh.local/gh.ssl (newrelic array command, or plain python for ee.gh) and dev (watchmedo auto-restart over the api source dirs). Each service reuses its sibling's env_file so COMPOSIO_WEBHOOK_SECRET flows in, and gets a /proc/1/cmdline healthcheck on entrypoints.worker_triggers. 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 |
fcd3cda to
ec3d94e
Compare
|
Superseded by #4749, which consolidates the entire gateway-triggers work (api + web + hosting + docs) into a single PR. |
Context
The lane below this one adds a
worker_triggersprocess that drains thequeues:triggersRedis Stream and invokes bound workflows. None of the compose stacks launch it yet, so on a real deployment trigger events would enqueue and sit there with nothing consuming them.Changes
Adds a
worker-triggersservice to every OSS and EE compose file, mirroring the existingworker-webhooksservice in each file so the shape stays consistent per environment:gh,gh.local,gh.ssl: the newrelic array command (newrelic-admin run-program python -m entrypoints.worker_triggers), exceptee.ghwhich uses the plainpython -m ...form like its webhook sibling.dev:watchmedo auto-restartover the api source dirs so edits toworker_triggers.pyreload without a rebuild (it reuses the already-built dev api image).Each new service reuses its sibling's
env_file, soCOMPOSIO_WEBHOOK_SECRETand the rest of the api config flow in with no extra wiring. Each gets a/proc/1/cmdlinehealthcheck assertingentrypoints.worker_triggersis the running process.The matching SaaS production compose lives in the separate
agenta_cloudrepo and is handled there.Tests / notes
worker-triggersservice.