-
Notifications
You must be signed in to change notification settings - Fork 2.5k
improvement(triggers): revert to start block #1757
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
* 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
…ad support for more blocks
…hboard improvements
* 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
…cp improvements, local kb file storage
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
There was a problem hiding this 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_triggerblock with reserved fields (input,conversationId,files) and extensibleinputFormatsub-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 || bodytoinput: bodyfor full payload access - Status API now gracefully handles empty workflows instead of returning errors
- Deploy modal and workflow execution hooks updated to prioritize
start_triggerover legacy triggers - Documentation updated to recommend Start block as the primary trigger
Issues Found:
Date.now()in control-bar'suseMemodependency 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
19 files reviewed, 1 comment
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/control-bar/control-bar.tsx
Outdated
Show resolved
Hide resolved
|
@icecrasher321 need to update docs as well to reflect this |
Summary
Bring start block back consolidating API, Chat, Input Form, Manual triggers into Start Block.
Type of Change
Testing
Manually across all legacy triggers + new start block with @aadamgough
Checklist