-
Notifications
You must be signed in to change notification settings - Fork 121
Start workflow api #1014
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
Start workflow api #1014
Conversation
src/route-handlers/start-workflow/helpers/__tests__/process-workflow-input.node.ts
Outdated
Show resolved
Hide resolved
src/route-handlers/start-workflow/__tests__/start-workflow.node.ts
Outdated
Show resolved
Hide resolved
src/route-handlers/start-workflow/__tests__/start-workflow.node.ts
Outdated
Show resolved
Hide resolved
src/route-handlers/start-workflow/__tests__/start-workflow.node.ts
Outdated
Show resolved
Hide resolved
src/route-handlers/start-workflow/helpers/process-workflow-input.ts
Outdated
Show resolved
Hide resolved
src/route-handlers/start-workflow/helpers/process-workflow-input.ts
Outdated
Show resolved
Hide resolved
…st-body-schema.ts Co-authored-by: Copilot <[email protected]>
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.
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.
src/route-handlers/start-workflow/helpers/process-workflow-input.ts
Outdated
Show resolved
Hide resolved
…ut.ts Fix typo Co-authored-by: Copilot <[email protected]>
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
Testing