Skip to content

Conversation

Assem-Uber
Copy link
Contributor

Summary

Create Start workflow API that accepts required only fields for starting the workflow. It also accepts extra flag for SDK type to format input depending on the worker SDK language.

Changes

  • Create schema for start workflow fields
  • Create JSON schema
  • Create helper function to process input based on SDK language

Testing

  • Tested through custom local form

Copilot

This comment was marked as outdated.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements a Start Workflow API that accepts required fields for starting Cadence workflows with support for different worker SDK languages (Go and Java) to format inputs appropriately.

  • Create comprehensive schema validation for workflow start parameters including type, task list, timeouts, and optional scheduling
  • Add helper function to process workflow inputs differently based on worker SDK language (space-separated for Go, JSON array for Java)
  • Implement complete API endpoint with proper error handling and response formatting

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/utils/grpc/grpc-client.ts Adds gRPC method definition and client implementation for starting workflows
src/utils/route-handlers-middleware/middlewares/__mocks__/grpc-cluster-methods.ts Adds mock for startWorkflow method in test utilities
src/route-handlers/start-workflow/start-workflow.types.ts Defines TypeScript types for request/response structures and SDK language enum
src/route-handlers/start-workflow/start-workflow.constants.ts Defines supported worker SDK languages and default timeout values
src/route-handlers/start-workflow/schemas/start-workflow-request-body-schema.ts Implements Zod schema validation for API request body
src/route-handlers/start-workflow/schemas/json-value-schema.ts Creates recursive JSON value schema for workflow input validation
src/route-handlers/start-workflow/helpers/process-workflow-input.ts Implements SDK-specific input processing logic
src/route-handlers/start-workflow/helpers/process-workflow-input.types.ts Defines types for input processing helper function
src/route-handlers/start-workflow/start-workflow.ts Main API handler implementation with validation, processing, and error handling
src/route-handlers/start-workflow/helpers/__tests__/process-workflow-input.node.ts Comprehensive unit tests for input processing logic
src/route-handlers/start-workflow/__tests__/start-workflow.node.ts Integration tests for the main workflow start endpoint
src/app/api/domains/[domain]/[cluster]/workflows/start/route.ts Next.js API route configuration for the workflow start endpoint

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@Assem-Uber Assem-Uber merged commit 4d67f19 into cadence-workflow:master Sep 12, 2025
4 checks passed
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.

2 participants