Skip to content

fix(webhooks): non-polling webhook executions silently dropped after worker removal#4153

Merged
waleedlatif1 merged 1 commit intostagingfrom
waleedlatif1/fix-webhook-inline-execution
Apr 14, 2026
Merged

fix(webhooks): non-polling webhook executions silently dropped after worker removal#4153
waleedlatif1 merged 1 commit intostagingfrom
waleedlatif1/fix-webhook-inline-execution

Conversation

@waleedlatif1
Copy link
Copy Markdown
Collaborator

Summary

  • PR improvement(mothership): restructured stream, tool structures, code typing, file write/patch/append tools, timing issues #4090 replaced the if (!isBullMQEnabled()) guard with if (shouldExecuteInline()) in the webhook processor's inline execution path
  • shouldExecuteInline() returns false when Trigger.dev is the async backend (which it is in production), so the fire-and-forget execution block was never running
  • The BullMQ worker that previously picked up and executed these jobs was also deleted in the same PR, leaving no executor for non-polling webhook jobs
  • Non-polling webhooks (Slack, GitHub, generic, Microsoft Teams, WhatsApp, Zoom, etc.) were being enqueued to the inline database queue but never executed — jobs silently disappeared
  • Polling providers (Gmail, RSS, etc.) were unaffected since they route through Trigger.dev
  • Removed the shouldExecuteInline() guard so the inline execution always runs when jobs are enqueued to the inline database queue

Type of Change

  • Bug fix

Testing

Verified via CloudWatch logs — confirmed webhook executions for workflow 1f83dd97 were passing preprocessing and being queued but never executing after the v0.6.40 deploy. Last successful execution was April 13 5:33 PM PST, matching the deploy timeline.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 14, 2026

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Apr 14, 2026 3:37pm

Request Review

@cursor
Copy link
Copy Markdown

cursor bot commented Apr 14, 2026

PR Summary

Medium Risk
Changes webhook execution behavior by always starting/completing inline-queued jobs in a fire-and-forget path, which could impact throughput and failure handling if assumptions about executors/backends are wrong. Logic is localized but affects all non-Trigger.dev (inline) webhook executions.

Overview
Fixes a regression where non-polling webhooks enqueued to the inline DB job queue were never executed.

Removes the shouldExecuteInline() guard around the fire-and-forget executor in apps/sim/lib/webhooks/processor.ts, so inline-queued webhook-execution jobs are always startJob'd, run via executeWebhookJob, and then completeJob'd (or markJobFailed on error) for both HTTP-triggered and polled webhook paths.

Reviewed by Cursor Bugbot for commit fab7627. Configure here.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 14, 2026

Greptile Summary

This PR fixes a production regression introduced in #4090 where non-polling webhook executions (Slack, GitHub, Teams, WhatsApp, Zoom, etc.) were silently dropped. The root cause was that the shouldExecuteInline() guard inside the else branch of both queueWebhookExecution and processPolledWebhookEvent prevented the fire-and-forget IIFE from running when Trigger.dev is the async backend — because shouldExecuteInline() returns false in that configuration — so jobs were enqueued to the inline DB queue but never executed. The fix removes that guard unconditionally so the inline execution always fires once a job reaches the else branch.

Confidence Score: 5/5

  • This PR is safe to merge — it restores a pre-existing, previously-working execution path that was accidentally broken in improvement(mothership): restructured stream, tool structures, code typing, file write/patch/append tools, timing issues #4090.
  • The change is minimal and surgical: a single guard removed in two parallel code blocks. The routing invariant is preserved — polling providers still go to Trigger.dev in production (isPolling && !shouldExecuteInline()), and non-polling always fall through to the inline path. Error handling inside the fire-and-forget IIFE is thorough (nested catch for markJobFailed). No P0 or P1 issues found; production evidence (CloudWatch) supports the diagnosis.
  • No files require special attention.

Important Files Changed

Filename Overview
apps/sim/lib/webhooks/processor.ts Removes the erroneous shouldExecuteInline() guard from the inline fire-and-forget execution block in both queueWebhookExecution and processPolledWebhookEvent, ensuring non-polling webhooks always execute after being enqueued to the inline DB queue.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Incoming Webhook Request] --> B[parseWebhookBody]
    B --> C[handleProviderChallenges]
    C --> D[findWebhookAndWorkflow]
    D --> E[verifyProviderAuth]
    E --> F[checkWebhookPreprocessing]
    F --> G{Preprocessing OK?}
    G -- No --> H[Return Error Response]
    G -- Yes --> I{isPollingProvider AND\nTrigger.dev enabled?}

    I -- Yes --> J[getJobQueue / Trigger.dev\nenqueue webhook-execution]
    J --> K[Return 200 Response]

    I -- No --> L[getInlineJobQueue\nenqueue webhook-execution]
    L --> M[fire-and-forget\nvoid async IIFE]
    M --> N[Return 200 Response]

    M --> O[jobQueue.startJob]
    O --> P[executeWebhookJob]
    P -- Success --> Q[jobQueue.completeJob]
    P -- Error --> R[jobQueue.markJobFailed]

    style I fill:#f9a825,color:#000
    style M fill:#4caf50,color:#fff
    style J fill:#1565c0,color:#fff
Loading

Reviews (1): Last reviewed commit: "fix(webhooks): non-polling webhook execu..." | Re-trigger Greptile

@waleedlatif1 waleedlatif1 changed the title fix(webhooks): non-polling webhook executions silently dropped after BullMQ removal fix(webhooks): non-polling webhook executions silently dropped after worker removal Apr 14, 2026
@waleedlatif1 waleedlatif1 merged commit a51333a into staging Apr 14, 2026
10 checks passed
@waleedlatif1 waleedlatif1 deleted the waleedlatif1/fix-webhook-inline-execution branch April 14, 2026 15:46
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