feat(openworkflow,dashboard): add child workflows#342
Conversation
commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
This pull request adds child workflow support to OpenWorkflow through a new step.invoke() API. The feature enables workflows to start and wait for child workflow runs durably, with timeout handling, parent-child linkage, and automatic parent wake-up when children complete.
Changes:
- Added
step.invoke()API to invoke child workflows with configurable timeouts (default 7 days) - Implemented parent-child workflow linkage via
parentStepAttemptIdandparentStepAttemptNamespaceIdfields - Added automatic parent workflow wake-up mechanism when child workflows reach terminal states
- Extended dashboard to display parent-child workflow relationships
Reviewed changes
Copilot reviewed 29 out of 29 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/openworkflow/worker/execution.ts | Core implementation of step.invoke() with timeout resolution, child workflow creation, and parent-child linking |
| packages/openworkflow/worker/execution.test.ts | Comprehensive test coverage for invoke functionality including timeout, failure propagation, and replay scenarios |
| packages/openworkflow/core/workflow-function.ts | Added InvokeStepConfig interface and updated StepApi with invoke method |
| packages/openworkflow/core/step-attempt.ts | Added "invoke" step kind and InvokeStepAttemptContext type |
| packages/openworkflow/core/error.ts | Added deserializeError to rehydrate errors from child workflows |
| packages/openworkflow/core/workflow-run.ts | Added isTerminalStatus helper function |
| packages/openworkflow/core/backend.ts | Added setStepAttemptChildWorkflowRun and parent step attempt fields to CreateWorkflowRunParams |
| packages/openworkflow/sqlite/backend.ts | Implemented wakeParentWorkflowRun and setStepAttemptChildWorkflowRun for SQLite |
| packages/openworkflow/postgres/backend.ts | Implemented wakeParentWorkflowRun and setStepAttemptChildWorkflowRun for PostgreSQL |
| packages/openworkflow/testing/backend.testsuite.ts | Added parent-child relationship tests and updated all createWorkflowRun calls with new fields |
| packages/dashboard/src/routes/runs/$runId.tsx | Enhanced run details page to display parent and child workflow relationships |
| packages/dashboard/src/routes/index.tsx | Updated run list loader to fetch parent workflow information for child runs |
| packages/dashboard/src/components/run-list.tsx | Added child run relation badges to workflow run list |
| packages/dashboard/src/lib/api.ts | Added getStepAttemptServerFn for fetching step attempts |
| packages/docs/docs/steps.mdx | Documented step.invoke() API with examples |
| packages/docs/docs/workflows.mdx | Updated workflow status table to mention step.invoke |
| openworkflow/hello-world-parent.ts | Added example parent workflow demonstrating child invocation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| {config.label} | ||
| </Badge> | ||
| {childRunRelation && ( | ||
| <Badge variant="outline" className=""> |
There was a problem hiding this comment.
Empty className attribute on Badge component. Consider removing it if no additional styling is needed, or add the intended class if one was accidentally deleted.
| <Badge variant="outline" className=""> | |
| <Badge variant="outline"> |
a1ca782 to
2a0d036
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 29 out of 29 changed files in this pull request and generated 8 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This PR adds
step.invoke()to invoke child workflows and visibility in the dashboard.