Skip to content

Apply node.input to the Step of Execution and simulateTask #332

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

Merged
merged 4 commits into from
Jun 17, 2025

Conversation

chrisli30
Copy link
Member

@chrisli30 chrisli30 commented Jun 17, 2025

This pull request introduces enhancements to the task engine's handling of input data, improves debugging capabilities, and refactors variable management for workflow nodes. The changes primarily focus on supporting dual-access mappings for input and output data, refining logging mechanisms, and ensuring backward compatibility with existing workflows.

Enhancements to input data handling:

  • Added extraction and processing of trigger input data in SimulateTask, RunTask, and RunTriggerRPC, enabling dual-access mappings for better input data management. (core/taskengine/engine.go [1] [2] [3]; core/taskengine/executor.go [4] [5] [6]; core/taskengine/run_node_immediately.go [7] [8]

Improvements to debugging and logging:

  • Enhanced collectInputKeysForLog to exclude current node variables and added detailed debug logs for better traceability during execution. (core/taskengine/vm.go core/taskengine/vm.goL1518-R1648)
  • Included input data in execution logs for various node types (e.g., REST API, GraphQL, contract reads/writes, custom code, etc.) to facilitate debugging. (core/taskengine/vm.go [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]

Refactoring variable management:

  • Introduced SetInputVarForStep to manage input variables for workflow nodes, ensuring dual-access mappings and backward compatibility. (core/taskengine/vm.go [1] [2]
  • Refactored variable initialization and updates to support both data and input fields for nodes and triggers. (core/taskengine/vm.go [1] [2]; core/taskengine/engine.go [3] [4]; core/taskengine/executor.go [5] [6]

Code cleanup and dependency updates:

  • Updated imports to include structpb for handling protobuf values and reorganized imports for better readability. (core/taskengine/engine.go [1]; core/taskengine/executor.go [2]; core/taskengine/vm.go [3]

These changes collectively improve the task engine's flexibility, debugging capabilities, and compatibility with complex workflows.

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 extends the system to capture and propagate user-provided input data (node.input and trigger.input) throughout execution and simulation. It adds new input fields to protobuf messages, updates GRPC method signatures, and enhances the VM and per-node processors to set and log those inputs.

  • Added input fields to all trigger and node protobuf messages and updated RPC definitions.
  • Updated VM (vm.go) and each *Processor.Execute to extract, store, and include input data in Execution_Step.
  • Modified collectInputKeysForLog to skip the current node and emit both .data and .input entries.

Reviewed Changes

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

File Description
protobuf/avs.proto Added input fields to trigger and node messages and updated RPC request.
core/taskengine/vm_runner_rest.go Extract and include node.Input in Execution_Step.
core/taskengine/vm.go New ExtractNodeInputData, SetInputVarForStep, enhanced input propagation and collectInputKeysForLog.
Comments suppressed due to low confidence (1)

core/taskengine/vm.go:819

  • There are no tests validating that Execution_Step.Input is correctly set or that collectInputKeysForLog correctly excludes the current node. Adding unit tests for these new behaviors will help catch regressions.
// Extract and set input data for this node (making it available as node_name.input)

@chrisli30 chrisli30 merged commit d3b12b1 into staging Jun 17, 2025
16 checks passed
@chrisli30 chrisli30 deleted the chris-add_node_input branch June 17, 2025 10:29
chrisli30 added a commit that referenced this pull request Jun 17, 2025
* Updated avs.proto and generated protobuf files

* Apply node.input to the Step of Execution

* Extract trigger input data using the proper extraction function

* Fixed the input of mannual trigger
chrisli30 added a commit that referenced this pull request Jun 18, 2025
* Updated avs.proto and generated protobuf files

* Apply node.input to the Step of Execution

* Extract trigger input data using the proper extraction function

* Fixed the input of mannual trigger
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.

1 participant