Skip to content

fix(executor): surface pre-execution errors - #1917

Merged
Sg312 merged 1 commit into
stagingfrom
fix/pre-execution-error
Nov 12, 2025
Merged

fix(executor): surface pre-execution errors#1917
Sg312 merged 1 commit into
stagingfrom
fix/pre-execution-error

Conversation

@Sg312

Copy link
Copy Markdown
Collaborator

Summary

Surface pre-execution errors

Type of Change

  • Bug fix

Testing

Manual

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

vercelBot commented Nov 12, 2025

Copy link
Copy Markdown

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

1 Skipped Deployment
ProjectDeploymentPreviewCommentsUpdated (UTC)
docsSkippedSkippedNov 12, 2025 9:02am

@Sg312
Sg312 merged commit 41066b8 into stagingNov 12, 2025
9 checks passed
@greptile-apps

Copy link
Copy Markdown
Contributor

Greptile Overview

Greptile Summary

This PR adds console logging for pre-execution validation errors that occur before the workflow actually starts executing. Previously, when workflow validation failed (e.g., missing trigger blocks, invalid configuration), these errors would be sent via the execution:error SSE event but would not appear in the user's terminal console.

Changes:

  • Added an addConsole() call within the onExecutionError callback in use-workflow-execution.ts:1008-1022
  • The console entry uses blockId: 'workflow' and blockType: 'workflow' to indicate this is a workflow-level error rather than a specific block error
  • Surfaces errors that happen during validation or initialization, before any blocks execute

Impact:

  • Improves user visibility of pre-execution errors
  • Consistent error handling - both block-level and workflow-level errors now appear in the console
  • Helps users understand why their workflow failed to start

Confidence Score: 5/5

  • This PR is safe to merge with no risk
  • The change is minimal and straightforward - it simply adds a console log entry when pre-execution errors occur. The implementation follows the exact same pattern as the existing onBlockError callback (lines 931-949), uses the correct types from ConsoleEntry interface, and properly passes all required fields. No logic changes, no breaking changes, and improves user experience by surfacing errors that were previously invisible in the console.
  • No files require special attention

Important Files Changed

File Analysis

FilenameScoreOverview
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/hooks/use-workflow-execution.ts5/5Added console logging for pre-execution errors in the onExecutionError callback to surface workflow validation errors to users

Sequence Diagram

sequenceDiagram
participant Client as Client/UI
participant Hook as useWorkflowExecution
participant Stream as useExecutionStream
participant API as /api/workflows/[id]/execute
participant Core as executeWorkflowCore
participant Console as TerminalConsole
Client->>Hook: handleRunWorkflow()
Hook->>Stream: execute(options)
Stream->>API: POST with SSE enabled
alt Pre-execution validation error
API->>Core: executeWorkflowCore()
Core-->>API: throws validation error
API->>API: catch error in SSE stream
API->>Stream: execution:error event
Stream->>Hook: onExecutionError(data)
Note over Hook: NEW: addConsole() called
Hook->>Console: addConsole({error, blockId: 'workflow'})
Console-->>Client: Display error in console
else Normal execution
API->>Core: executeWorkflowCore()
Core->>API: block events
API->>Stream: execution:completed event
Stream->>Hook: onExecutionCompleted(data)
end
Loading

@greptile-appsgreptile-appsBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

@waleedlatif1
waleedlatif1 deleted the fix/pre-execution-error branch November 12, 2025 15:39
@waleedlatif1waleedlatif1 mentioned this pull request Nov 12, 2025
10 tasks
Sign up for freeto 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

@Sg312