Skip to content

Conversation

@betterclever
Copy link
Contributor

This PR introduces support for conditional execution and branching within workflows, along with significant UI enhancements for better clarity during execution playback.

Key Changes:

1. Conditional Execution & Branching

  • Branching Logic: Implemented support for multiple outgoing paths from nodes (e.g., Manual Approval with 'approved' and 'rejected' branches).
  • Skip Propagation: When a branch is not taken, all subsequent nodes in that path are marked as `skipped` and propagated forward.
  • Trace Event Safety: Improved type safety for trace events, including `activatedPorts` to track exactly which branches were executed.

2. UI & Visualization Enhancements

  • Branch Visualization: Added dedicated branch pills to nodes that clearly show which path was taken during execution playback.
  • Edge Dimming: Edges originating from skipped nodes or untaken branches are now visually dimmed (muted color, dashed stroke) to highlight the active execution path.
  • Solid Node Backgrounds: Added solid backgrounds to all nodes to prevent transparency issues and improve visual clarity when nodes overlap.
  • Entry Point Improvements: Restored the default source handle for Entry Point nodes to ensure consistent workflow creation.

3. Backend & Worker Updates

  • Temporal Workflow Orchestration: Updated the workflow scheduler to handle branching results and manage the state of downstream nodes correctly.
  • Component SDK: Enhanced the trace service and execution context to record and report branch decisions reliably.
  • Validation: Augmented workflow validation to handle branching schemas.

Verified with E2E tests for branching and manual approval scenarios.

…tion

Signed-off-by: betterclever <paliwal.pranjal83@gmail.com>
- Add mandatory validation on workflow create/update to catch invalid port connections early
- Improve edge validation to reject ghost ports (edges with sourceHandle but missing targetHandle)
- Configure Kafka client with explicit timeouts (requestTimeout, retry, sessionTimeout, heartbeatInterval)
- Make Kafka ingest services skip gracefully when no brokers are configured instead of throwing errors
- Update run-component activity to return activeOutputPorts for conditional execution support

Signed-off-by: betterclever <paliwal.pranjal83@gmail.com>
- Add 'rejected' field to approval resolution output so downstream nodes can consume either port's data
- Fix test-conditional-execution-e2e.ts to correctly access result.outputs path
- Fix test-branching-e2e.ts to use proper edge format with targetHandle
- Fix test-branching-e2e.ts to use correct API payload format with responseData.status

Signed-off-by: betterclever <paliwal.pranjal83@gmail.com>
When a node is skipped due to conditional branching (e.g., the rejected path when approved),
display a slate-colored 'Skipped' badge with a Ban icon on the workflow canvas.
This provides visual feedback consistent with other status badges (Completed, Failed, Running).

Signed-off-by: betterclever <paliwal.pranjal83@gmail.com>
…fety

- update trace event schemas and interfaces with structured data types
- refactor activity and workflow code to use context.trace for automatic event enrichment
- remove redundant fields from trace event payloads
- implement edge dimming for untaken branches in the execution canvas
- add opaque backgrounds to nodes to prevent transparency issues when overlapping

Signed-off-by: betterclever <paliwal.pranjal83@gmail.com>
…int handle

- Reset branch pill visual state when switching from execution to design mode
- Re-add default source handle for Entry Point nodes to fix React Flow 'undefined' handle error

Signed-off-by: betterclever <paliwal.pranjal83@gmail.com>
Signed-off-by: betterclever <paliwal.pranjal83@gmail.com>
Signed-off-by: betterclever <paliwal.pranjal83@gmail.com>
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 270 to 274
} else if (inputType === 'selection') {
// Activate ports for selected options
const selection = (resolution.responseData as any)?.selection;
if (Array.isArray(selection)) {
selection.forEach((val: string) => activePorts.push(`option:${val}`));

Choose a reason for hiding this comment

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

P1 Badge Activate selection output port for manual selections

When inputType === 'selection' you only add option:${val} (plus approved/rejected) to activePorts, but the Manual Selection component still exposes a selection output. The scheduler now uses activePorts to decide which success edges are active, so any workflow that connects the selection output (the existing, non-branching usage) will have those edges treated as inactive and downstream nodes skipped. This is a regression for selection workflows that rely on the selection value without using option-specific branches.

Useful? React with 👍 / 👎.

… events

Signed-off-by: betterclever <paliwal.pranjal83@gmail.com>
…lection

Signed-off-by: betterclever <paliwal.pranjal83@gmail.com>
@betterclever betterclever merged commit c276eda into main Dec 28, 2025
3 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