[☂️] Dify Trigger — Backend: Unified Entry of Workflow #16192

Closed
opened 2026-02-21 19:25:02 -05:00 by yindo · 2 comments
Owner

Originally created by @Yeuoly on GitHub (Aug 15, 2025).

Originally assigned to: @Yeuoly on GitHub.

[Sub-issue] Backend — Unified Trigger Entry (Billing + Rate Limiting + Celery)

Assignee: @Yeuoly (align with @laipz8200)
Related umbrella: #23981

DDL

DDL: 2025.8.31

Goal

Provide a single backend entry for all Trigger types (Webhook / Schedule / Plugins) that:

  • Performs authN/authZ, billing metering, rate limiting, and quota checks.
  • Normalizes incoming trigger payloads into a canonical internal event.
  • Enqueues the workflow execution into Celery with correct tenant/app/workflow context.
  • Guarantees idempotency, observability, and operational safety (retries, backpressure).

This entry is not the start node; it’s the trigger gateway that produces workflow inputs and dispatches to workers.


Scope

  • Trigger gateway service/module exposing a unified invoke path (internal API boundary).
  • Built-in handlers for Webhook / Schedule / Plugins to map request → canonical event.
  • Hooks for billing (metering units, per-tenant plan), rate limiting (global/per-tenant/per-trigger).
  • Celery dispatch (queue selection, priority, retries).
  • Metrics/logs/tracing with correlation IDs.
  • Idempotency (dedupe on idempotency_key).
  • Error model (typed errors + HTTP/gRPC status if applicable).

Out of Scope

  • Concrete Webhook node, Schedule center/node, Plugin definitions (handled by other sub-issues).
  • Frontend/Canvas UI.
Originally created by @Yeuoly on GitHub (Aug 15, 2025). Originally assigned to: @Yeuoly on GitHub. # [Sub-issue] Backend — Unified Trigger Entry (Billing + Rate Limiting + Celery) **Assignee:** @Yeuoly (align with @laipz8200) **Related umbrella:** #23981 ## DDL **DDL:** 2025.8.31 ## Goal Provide a **single backend entry** for all Trigger types (Webhook / Schedule / Plugins) that: - Performs **authN/authZ**, **billing metering**, **rate limiting**, and **quota** checks. - **Normalizes** incoming trigger payloads into a canonical internal event. - **Enqueues** the workflow execution into **Celery** with correct tenant/app/workflow context. - Guarantees **idempotency**, **observability**, and **operational safety** (retries, backpressure). > This entry is not the start node; it’s the trigger gateway that produces workflow inputs and dispatches to workers. --- ## Scope - Trigger gateway service/module exposing a **unified invoke path** (internal API boundary). - Built-in handlers for **Webhook / Schedule / Plugins** to map request → canonical event. - Hooks for **billing** (metering units, per-tenant plan), **rate limiting** (global/per-tenant/per-trigger). - **Celery** dispatch (queue selection, priority, retries). - **Metrics/logs/tracing** with correlation IDs. - **Idempotency** (dedupe on `idempotency_key`). - **Error model** (typed errors + HTTP/gRPC status if applicable). ### Out of Scope - Concrete Webhook node, Schedule center/node, Plugin definitions (handled by other sub-issues). - Frontend/Canvas UI.
yindo added the 🌊 feat:workflow label 2026-02-21 19:25:02 -05:00
yindo closed this issue 2026-02-21 19:25:02 -05:00
Author
Owner

@bowenliang123 commented on GitHub (Aug 15, 2025):

Subtasks to do:

  1. [api] add unified API entry for API access, accepting events for Webhook / Schedule / Plugins
  2. [api] create task by dispatching canonical event into the event queue in Celery for async execution
  3. [worker] create event handlers for each type of the event
  4. [api] billing support with usage metrics
  5. [worker] rate limit and quota support (is this on the worker side?)
  6. [api] idempotency guarantee by optional explicit request id of idempotency_key
@bowenliang123 commented on GitHub (Aug 15, 2025): Subtasks to do: 1. [api] add unified API entry for API access, accepting events for Webhook / Schedule / Plugins 2. [api] create task by dispatching canonical event into the event queue in Celery for async execution 3. [worker] create event handlers for each type of the event 4. [api] billing support with usage metrics 5. [worker] rate limit and quota support (is this on the worker side?) 6. [api] idempotency guarantee by optional explicit request id of `idempotency_key`
Author
Owner

@Yeuoly commented on GitHub (Aug 23, 2025):

Finished

@Yeuoly commented on GitHub (Aug 23, 2025): Finished
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#16192