oracle / oracle/wayflow

Feature Request: Declarative guard/skip predicate on InputMessageNode to bypass user prompt

Open
#147 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
188
Forks
23
Avg merge
1d 12h
Merged PRs (30d)
4

Description

Summary

InputMessageNode is a useful HITL gate for collecting user input mid-flow, but it has no node-level guard or pre-execution condition. To skip the prompt when required values are already present in flow state, the only available pattern is a BranchingNode with a 3-step predicate chain: PluginRegexNode (in list mode for empty-detection) → PluginTemplateNode (collapsing to "present" / "missing") → BranchingNode (mapping {"present": "skip"} to a label that bypasses the InputMessageNode).

This works, but is verbose: every skippable HITL gate requires four extra nodes plus the wiring edges. For flows with multiple optional HITL gates this multiplies into noise that obscures the actual control flow.

Reproduction (current pattern, abbreviated)

{
  "child_agent_a-uuid_match":     { "component_type": "PluginRegexNode", "regex_pattern": "^[0-9a-fA-F]{8}-…$", "return_first_match_only": false },
  "child_agent_a-predicate":      { "component_type": "PluginTemplateNode", "template": "{{ value | length }}" },
  "child_agent_a-check_inputs":   { "component_type": "BranchingNode", "branch_name_mapping": { "present": "skip" } },
  "child_agent_a-data_gate":      { "component_type": "InputMessageNode", "...": "..." },
  "child_agent_a-generate":       { "component_type": "ApiNode", "...": "..." }
}

…plus six edges to wire the four-node predicate chain into the existing data_gate → generate flow.

Feature request

Add an optional guard (or skip_when) field on InputMessageNode that accepts a JSON-pointer / Jinja predicate against flow state. When the predicate evaluates to true, the runtime skips the node without raising, and downstream DataFlowEdges resolve from existing flow state.

{
  "child_agent_a-data_gate": {
    "component_type": "InputMessageNode",
    "guard": {
      "kind": "all_present",
      "inputs": ["dataRefA", "dataRefB"]
    }
  }
}

This collapses 4 nodes + 6 edges into 1 node + 0 extra edges per skippable gate, dramatically improving flow readability.

Suggested implementation

InputMessageNode.execute() checks self.guard first; if the predicate is truthy against the conversation's input state, the executor returns immediately with no UserMessageRequestStatus — proceeding to whichever node the existing control flow edges target next.

The predicate language can start minimal: { "kind": "all_present", "inputs": [name, ...] } and { "kind": "any_present", "inputs": [name, ...] }. Jinja support can come later.

Related

Distinct from #145 (input-required propagation across A2A boundary) — that concerns runtime state communication. This issue concerns declaring an inline guard predicate so the runtime can skip the prompt entirely without a separate BranchingNode chain.

Environment

  • wayflowcore[a2a]==26.1.1
  • Python 3.11

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at InputMessageNode.execute() and inspect how the executor handles UserMessageRequestStatus and downstream DataFlowEdge resolution. Compare existing BranchingNode predicate behavior with the proposed all_present and any_present guard forms. Done means a guarded node skips the prompt when its flow-state condition is true and existing control flow continues without raising.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.