Skip to content

[chore] Mount worker-triggers in all compose stacks#4743

Closed
jp-agenta wants to merge 5 commits into
wp4-ingress-dispatchfrom
hosting-worker-triggers
Closed

[chore] Mount worker-triggers in all compose stacks#4743
jp-agenta wants to merge 5 commits into
wp4-ingress-dispatchfrom
hosting-worker-triggers

Conversation

@jp-agenta

Copy link
Copy Markdown
Member

Context

The lane below this one adds a worker_triggers process that drains the queues:triggers Redis 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-triggers service to every OSS and EE compose file, mirroring the existing worker-webhooks service 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), except ee.gh which uses the plain python -m ... form like its webhook sibling.
  • dev: watchmedo auto-restart over the api source dirs so edits to worker_triggers.py reload without a rebuild (it reuses the already-built dev api image).

Each new service reuses its sibling's env_file, so COMPOSIO_WEBHOOK_SECRET and the rest of the api config flow in with no extra wiring. Each gets a /proc/1/cmdline healthcheck asserting entrypoints.worker_triggers is the running process.

The matching SaaS production compose lives in the separate agenta_cloud repo and is handled there.

Tests / notes

  • All seven files parse as valid YAML; each has exactly one worker-triggers service.
  • Not yet run end to end against live infra. The dev image needs no rebuild for the worker to pick up the entrypoint (bind-mounted source + watchmedo).

jp-agenta and others added 5 commits June 18, 2026 18:22
… 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>
@vercel

vercel Bot commented Jun 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agenta-documentation Ready Ready Preview, Comment Jun 18, 2026 5:30pm

Request Review

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 20fa0381-1f8e-4dc6-98fd-278f99063f9f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch hosting-worker-triggers

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@junaway junaway force-pushed the wp4-ingress-dispatch branch from fcd3cda to ec3d94e Compare June 19, 2026 08:59
@jp-agenta

Copy link
Copy Markdown
Member Author

Superseded by #4749, which consolidates the entire gateway-triggers work (api + web + hosting + docs) into a single PR.

@jp-agenta jp-agenta closed this Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant