Skip to content

Conversation

@fiftin
Copy link
Collaborator

@fiftin fiftin commented Nov 25, 2025

SONNET 4.5

Add a Workflow feature with a visual editor and execution engine to enable multi-step automation pipelines.

This PR introduces a complete workflow orchestration system, including new database models, a REST API, a robust execution engine, and a Vue.js frontend for visual editing and real-time monitoring. It allows users to define and run complex, multi-step automation processes with sequential, parallel, and conditional logic, addressing a critical missing feature in Semaphore UI.


Open in Cursor Open in Web

@cursor
Copy link

cursor bot commented Nov 25, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +318 to +320
run, err := helpers.Store(r).GetWorkflowRun(workflowRunID)
if err != nil {
helpers.WriteError(w, err)

Choose a reason for hiding this comment

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

P1 Badge Scope workflow run fetch to current workflow

The workflow run detail endpoint fetches a run solely by run_id and returns it without checking that it belongs to the project/workflow in the path. Because WorkflowMiddleware only loads the workflow (lines 19–38) and GetWorkflowRun then calls helpers.Store(r).GetWorkflowRun(runID) without comparing run.WorkflowID/ProjectID to the request context, a user who knows another project’s run ID can read its status and node_runs via /project/{projectId}/workflows/{workflowId}/runs/{runId} even if the IDs don’t match. This leaks execution data across projects.

Useful? React with 👍 / 👎.

Comment on lines +346 to +347
run, err := helpers.Store(r).GetWorkflowRun(workflowRunID)
if err != nil {

Choose a reason for hiding this comment

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

P1 Badge Prevent stopping workflow runs across projects

The stop endpoint also looks up the run by ID only (GetWorkflowRun(runID)) before force-updating its status and node runs. There is no check that the run’s project_id/workflow_id matches the route parameters loaded by WorkflowMiddleware, so a user with access to any project can issue /project/{projectId}/workflows/{workflowId}/runs/{runId}/stop against a foreign run ID and mark another project’s run as stopped. This allows cross-project disruption of executions.

Useful? React with 👍 / 👎.

Comment on lines +408 to +411
const linksToSave = this.workflow.links.map((link) => ({
...link,
// Remove temp IDs if they exist
id: link.id || undefined,

Choose a reason for hiding this comment

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

P1 Badge Saving new links sends temporary node ids

When saving a workflow, linksToSave is sent to the API exactly as stored in this.workflow.links with only the id field stripped. New links are built from getNodeId, which returns temp_id strings for unsaved nodes; those string from_node_id/to_node_id values are forwarded here without remapping to real node IDs. The backend WorkflowLink expects integers, so saving a workflow that includes links to newly added nodes will fail to unmarshal/insert, preventing users from persisting new connections until after IDs somehow exist.

Useful? React with 👍 / 👎.

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.

3 participants