Skip to content

fix(workflow-block): webhook URL never hydrates on canvas#4150

Merged
waleedlatif1 merged 1 commit intostagingfrom
waleedlatif1/fix-webhook-url-hydration
Apr 14, 2026
Merged

fix(workflow-block): webhook URL never hydrates on canvas#4150
waleedlatif1 merged 1 commit intostagingfrom
waleedlatif1/fix-webhook-url-hydration

Conversation

@waleedlatif1
Copy link
Copy Markdown
Collaborator

@waleedlatif1 waleedlatif1 commented Apr 14, 2026

Summary

  • Webhook URL on trigger block cards always showed - instead of the actual URL
  • Root cause: getTrigger() namespaces condition-gated subBlock IDs (e.g. webhookUrlDisplaywebhookUrlDisplay_github_release_published), but the block card's useMemo checked for an exact match on 'webhookUrlDisplay' which never matched
  • Fix: use startsWith('webhookUrlDisplay') instead of exact equality

Test plan

  • Open a workflow with a GitHub (or other webhook) trigger block in trigger mode
  • Verify the block card on the canvas shows the webhook URL instead of -
  • Verify the editor panel still shows the webhook URL correctly (was not affected)
  • Verify non-webhook trigger blocks (polling triggers like Gmail) are unaffected

…k ID

getTrigger() namespaces condition-gated subBlock IDs (e.g. webhookUrlDisplay
→ webhookUrlDisplay_github_release_published). The block card's useMemo was
checking for an exact match on 'webhookUrlDisplay', which never matched.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@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:14am

Request Review

@cursor
Copy link
Copy Markdown

cursor bot commented Apr 14, 2026

PR Summary

Low Risk
Low risk UI-only change that broadens the matching condition for webhook URL display; potential risk is unintended matches if other subBlock IDs share the same prefix.

Overview
Fixes webhook trigger block cards on the canvas showing - for the webhook URL by recognizing namespaced subBlock IDs.

The webhookUrlDisplayValue hydration now checks subBlock.id.startsWith('webhookUrlDisplay') (instead of exact equality), allowing the display URL to render when trigger mode conditionally appends suffixes to the subBlock ID.

Reviewed by Cursor Bugbot for commit 580b612. Configure here.

@waleedlatif1 waleedlatif1 changed the title fix(block-card): webhook URL never hydrates on canvas fix(workflow-block): webhook URL never hydrates on canvas Apr 14, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 14, 2026

Greptile Summary

This PR fixes webhook URL display on canvas block cards for trigger blocks that use buildTriggerSubBlocks. The root cause was that getTrigger() namespaces display-only subBlock IDs conditioned on selectedTriggerId (e.g. webhookUrlDisplaywebhookUrlDisplay_github_release_published), but the useMemo guard used strict equality (=== 'webhookUrlDisplay'), which never matched namespaced IDs. Changing to startsWith('webhookUrlDisplay') correctly covers both the bare ID (simple single-event triggers like WhatsApp) and all namespaced variants (multi-event triggers like GitHub, Linear, Jira).

Confidence Score: 5/5

  • Safe to merge — minimal, targeted fix with no unintended side-effects.
  • The single-line change from strict equality to startsWith is correct. No other subBlock IDs in the codebase share the webhookUrlDisplay prefix, so there is no false-positive risk. The fix covers both un-namespaced (simple triggers) and namespaced (multi-event triggers) IDs, and leaves unrelated rendering paths untouched. No P0/P1 findings.
  • No files require special attention.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/workflow-block.tsx One-line guard changed from exact equality to startsWith on subBlock.id for the webhookUrlDisplayValue memo — correctly handles namespaced IDs produced by getTrigger(). No other subBlock IDs in the codebase share this prefix, so the change is safe.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[SubBlockRow renders] --> B{subBlock.id<br/>startsWith 'webhookUrlDisplay'?}
    B -- "No (e.g. 'tableId')" --> C[webhookUrlDisplayValue = null]
    B -- "Yes (e.g. 'webhookUrlDisplay'<br/>or 'webhookUrlDisplay_github_release_published')" --> D{allSubBlockValues<br/>triggerPath set?}
    D -- Yes --> E["URL = baseUrl + /api/webhooks/trigger/ + triggerPath"]
    D -- No --> F["URL = baseUrl + /api/webhooks/trigger/ + blockId"]
    E --> G[hydratedName = URL]
    F --> G
    G --> H[displayValue shows webhook URL on canvas]
    C --> I[hydratedName skips webhookUrlDisplayValue]
    I --> J[displayValue falls back to raw value or '-']

    subgraph getTrigger namespacing
        K["webhookUrlDisplay (bare — no selectedTriggerId condition)"] --> L["ID unchanged"]
        M["webhookUrlDisplay (condition: selectedTriggerId)"] --> N["ID → webhookUrlDisplay_triggerId"]
    end
Loading

Reviews (1): Last reviewed commit: "fix(block-card): webhook URL never hydra..." | Re-trigger Greptile

@waleedlatif1 waleedlatif1 merged commit 85fda99 into staging Apr 14, 2026
14 checks passed
@waleedlatif1 waleedlatif1 deleted the waleedlatif1/fix-webhook-url-hydration branch April 14, 2026 03:19
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