sim icon indicating copy to clipboard operation
sim copied to clipboard

Update API endpoint for workflow execution

Open darkliyznyanlin910 opened this issue 3 months ago • 2 comments

Summary

Bug fix in Workflow Executor Tool

Fixes #(issue)

Type of Change

  • [x] Bug fix
  • [ ] New feature
  • [ ] Breaking change
  • [ ] Documentation
  • [ ] Other: ___________

Testing

How has this been tested? What should reviewers focus on?

Checklist

  • [x] Code follows project style guidelines
  • [x] Self-reviewed my changes
  • [x] Tests added/updated and passing
  • [x] No new warnings introduced
  • [x] I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Screenshots/Videos

darkliyznyanlin910 avatar Nov 18 '25 09:11 darkliyznyanlin910

@darkliyznyanlin910 is attempting to deploy a commit to the Sim Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Nov 18 '25 09:11 vercel[bot]

Greptile Summary

  • Updates workflow executor tool URL from static /api/tools/workflow-executor to dynamic /api/workflows/{workflowId}/execute endpoint
  • Shifts architecture from generic tool endpoint to RESTful resource-based endpoint using workflow ID in URL path

Important Files Changed

Filename Overview
apps/sim/tools/workflow/executor.ts Updated URL construction to use parameterized path with workflowId instead of static endpoint

Confidence score: 3/5

  • This PR requires careful review as it represents a breaking change in API endpoint structure
  • Score reflects potential integration issues if backend routes haven't been updated to match, and concerns about cascading effects on dependent systems
  • Pay close attention to apps/sim/tools/workflow/executor.ts and verify corresponding backend API routes exist

Sequence Diagram

sequenceDiagram
    participant User
    participant WorkflowExecutorTool
    participant API
    participant ChildWorkflow
    participant Logger

    User->>WorkflowExecutorTool: "Execute workflow with workflowId and inputMapping"
    WorkflowExecutorTool->>API: "POST /api/workflows/{workflowId}/execute"
    API->>ChildWorkflow: "Execute child workflow"
    ChildWorkflow->>API: "Return execution results"
    API->>WorkflowExecutorTool: "Response with success, duration, childWorkflowId"
    WorkflowExecutorTool->>Logger: "Log workflow executor response"
    WorkflowExecutorTool->>User: "Return transformed response with execution details"

greptile-apps[bot] avatar Nov 18 '25 09:11 greptile-apps[bot]