Skip to content

fix(workflow): allow dual-mode blocks inside loop/parallel subflows - #6633

Merged
waleedlatif1 merged 1 commit into
stagingfrom
fix/triggers-in-loop-block-picker
Aug 12, 2026
Merged

fix(workflow): allow dual-mode blocks inside loop/parallel subflows#6633
waleedlatif1 merged 1 commit into
stagingfrom
fix/triggers-in-loop-block-picker

Conversation

@j15z

@j15z j15z commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Fixes the block picker rejecting dual-mode blocks (Gmail, Slack, etc.) with "Triggers cannot be placed inside loop or parallel subflows" when adding them inside a loop/parallel via a dragged connection
  • The drop-path guard treated the config capability flag (triggers.enabled) as if the block were a trigger; it now only rejects blocks that will actually be triggers — pure trigger blocks (category === 'triggers') and explicit trigger-mode drops (enableTriggerMode)
  • Matches the semantics every other guard already uses (TriggerUtils.isTriggerBlock checks the actual triggerMode state)

Type of Change

  • Bug fix

Testing

Traced the full picker → add-block-from-toolbarhandleToolbarDrop path; type-check, lint, and the full audit suite pass. Pure trigger blocks and trigger-mode drags are still rejected from subflows.

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

vercel Bot commented Aug 12, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Aug 12, 2026 6:29pm

Request Review

@cursor

cursor Bot commented Aug 12, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Single guard condition in canvas drop handling; behavior aligns with existing trigger checks elsewhere with no auth or data changes.

Overview
Fixes a false positive when dropping blocks into loop or parallel subflows via the toolbar or connection picker: dual-mode integrations (e.g. Gmail, Slack) were blocked with “Triggers cannot be placed inside loop or parallel subflows” even when added as normal action blocks.

In handleToolbarDrop, the subflow guard no longer treats blockConfig.triggers?.enabled as “this drop is a trigger.” It only rejects pure trigger blocks (category === 'triggers') and drops with enableTriggerMode === true, matching TriggerUtils.isTriggerBlock and the drag/paste paths that use actual trigger mode state.

Reviewed by Cursor Bugbot for commit 508ebe3. Bugbot is set up for automated code reviews on this repo. Configure here.

@greptile-apps

greptile-apps Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR corrects subflow block insertion by distinguishing trigger capability from actual trigger mode.

  • Allows dual-mode integration blocks to be added as ordinary blocks inside loop and parallel subflows.
  • Continues rejecting pure trigger blocks and dual-mode blocks explicitly dropped in trigger mode.

Confidence Score: 5/5

The PR appears safe to merge with no actionable defects identified in the changed trigger-placement guard.

Current insertion paths preserve explicit trigger mode when selecting a block as a trigger, while ordinary dual-mode selections are initialized without trigger mode as intended.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx Narrows the subflow placement guard to actual trigger drops while preserving rejection for pure and explicitly enabled triggers.

Reviews (1): Last reviewed commit: "fix(workflow): allow dual-mode blocks in..." | Re-trigger Greptile

@waleedlatif1
waleedlatif1 merged commit c411b1d into staging Aug 12, 2026
24 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/triggers-in-loop-block-picker branch August 12, 2026 18:34
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.

2 participants