Skip to content

Conversation

@icecrasher321
Copy link
Collaborator

@icecrasher321 icecrasher321 commented Oct 28, 2025

Summary

Bring start block back consolidating API, Chat, Input Form, Manual triggers into Start Block.

Type of Change

  • Other: Platform Improvement

Testing

Manually across all legacy triggers + new start block with @aadamgough

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)

waleedlatif1 and others added 17 commits October 11, 2025 22:23
* improvement(performance): remove unused source/target indices, add index on snapshot id (#1603)

* fix(blog): rename building to blogs with redirect (#1604)

* improvement(privacy-policy): updated privacy policy for google (#1602)

* updated privacy policy for google

* update terms, privacy, and emails to incl address and update verbiage

* feat(guardrails): added guardrails block/tools and docs (#1605)

* Adding guardrails block

* ack PR comments

* cleanup checkbox in dark mode

* cleanup

* fix supabase tools

* fix(inference-billing): fix inference billing when stream is true via API, add drag-and-drop functionality to deployed chat (#1606)

* fix(inference): fix inference billing when stream is true via API

* add drag-and-drop to deployed chat

* feat(mistal): added mistral as a provider, updated model prices (#1607)

* feat(mistal): added mistral as a provider, updated model prices

* remove the ability for a block to reference its own outluts

* fixed order of responses for guardrails block

* feat(versions): added the ability to rename deployment versions (#1610)

* fix(vulns): fix various vulnerabilities and enhanced code security (#1611)

* fix(vulns): fix SSRF vulnerabilities

* cleanup

* cleanup

* regen docs

* remove unused deps

* fix failing tests

* cleanup

* update deps

* regen bun lock
* fix(debug-mode): remove duplicate debug mode flag (#1714)

* feat(i18n): update translations (#1709)

* improvement(condition): added variable and envvar highlighting for condition input (#1718)

* fix(dashboard): add additional context for paginated logs in dashboard, add empty state when selected cell has no data (#1719)

* fix(dashboard): add additional context for paginated logs in dashboard, add empty state when selected cell has no data

* apps/sim

* renaming

* remove relative import

* feat(tools): added webflow OAuth + tools (#1720)

* feat(tools): added webflow OAuth + tools

* remove itemId from delete item

* remove siteId

* added webhook triggers + oauth scopes + site/collection selector

* update sample payload for webflow triggers

* cleanup

* fix discord color

* feat(i18n): update translations (#1721)

* improvement(schedule): fix UI bug with schedule modal (#1722)
* fix(already-cancelled-sub): UI should allow restoring subscription

* restore functionality fixed

* fix
@vercel
Copy link

vercel bot commented Oct 28, 2025

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

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
docs Skipped Skipped Oct 31, 2025 7:22pm

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Overview

Greptile Summary

This PR introduces a unified Start block that replaces separate API, Chat, Input Form, and Manual triggers. The Start block handles all three execution contexts (manual editor runs, API deployments, and chat deployments) through a single interface.

Key Changes:

  • Added new start_trigger block with reserved fields (input, conversationId, files) and extensible inputFormat sub-block
  • Legacy trigger blocks (api_trigger, chat_trigger, input_trigger, manual_trigger) marked as legacy and hidden from toolbar
  • Executor updated to pass through entire API payload for start_trigger while ensuring reserved fields are set
  • API execution route changed from input: body.input || body to input: body for full payload access
  • Status API now gracefully handles empty workflows instead of returning errors
  • Deploy modal and workflow execution hooks updated to prioritize start_trigger over legacy triggers
  • Documentation updated to recommend Start block as the primary trigger

Issues Found:

  • Date.now() in control-bar's useMemo dependency breaks memoization, causing constant recomputation and defeating the debounce optimization

Confidence Score: 4/5

  • Safe to merge with one performance issue to address in control-bar
  • The PR is well-structured with comprehensive backward compatibility for legacy triggers. The logic is sound and consistently applied across executor, API routes, and UI components. Score reduced by 1 due to the Date.now() performance bug in control-bar.tsx that defeats debouncing.
  • apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/control-bar/control-bar.tsx requires fixing the Date.now() issue on line 274

Important Files Changed

File Analysis

Filename Score Overview
apps/sim/blocks/blocks/start_trigger.ts 5/5 New unified start block config with input, conversationId, files fields for chat/manual/API runs
apps/sim/lib/workflows/triggers.ts 5/5 Updated trigger utilities to support start_trigger for all execution types (chat/manual/API)
apps/sim/executor/index.ts 4/5 Added start_trigger handling with pass-through payload logic and reserved field enforcement
apps/sim/app/api/workflows/[id]/execute/route.ts 5/5 Changed input extraction to pass entire body, prioritizes start_trigger over api_trigger
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/control-bar/control-bar.tsx 3/5 Added debounced status check trigger using useMemo and useDebounce, but Date.now() breaks memoization

Sequence Diagram

sequenceDiagram
    participant User
    participant Editor
    participant API as Execute API
    participant Executor
    participant StartBlock as Start Trigger Block
    
    alt Manual Run from Editor
        User->>Editor: Click Run
        Editor->>Editor: Extract test values from inputFormat
        Editor->>API: POST /api/workflows/{id}/execute
        Note over API: body = { input: testValues, ... }
    end
    
    alt API Deployment Call
        User->>API: POST /api/workflows/{id}/execute
        Note over API: body = { customField: value, ... }
    end
    
    alt Chat Deployment
        User->>API: POST /api/workflows/{id}/execute
        Note over API: body = { input: message, conversationId, stream: true }
    end
    
    API->>API: Load deployed workflow blocks
    API->>API: Find start_trigger or api_trigger
    API->>API: Extract inputFormat schema
    API->>API: Pass entire body as input
    
    API->>Executor: Execute workflow
    Note over API,Executor: workflowInput = entire body
    
    Executor->>Executor: Find start_trigger block
    
    alt With inputFormat defined
        Executor->>Executor: Structure input per schema
        Executor->>Executor: Apply type coercion
        Executor->>StartBlock: Initialize with structured fields
    end
    
    alt Without inputFormat
        Executor->>StartBlock: Pass through entire payload
    end
    
    Executor->>StartBlock: Ensure reserved fields
    Note over StartBlock: input: '' (default)<br/>conversationId: '' (default)<br/>files: [] (optional)
    
    StartBlock->>Executor: Output with all fields
    Executor->>Executor: Execute downstream blocks
    Executor->>API: Return execution results
    API->>User: Response
Loading

19 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Base automatically changed from staging to main October 29, 2025 08:40
@icecrasher321 icecrasher321 changed the base branch from main to staging October 31, 2025 19:15
@waleedlatif1
Copy link
Collaborator

@icecrasher321 need to update docs as well to reflect this

@waleedlatif1 waleedlatif1 deleted the improvement/sim-294 branch November 18, 2025 01:30
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.

4 participants