Skip to content

Add method to run any node with input variables #267

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

Open
wants to merge 2 commits into
base: staging
Choose a base branch
from

Conversation

devin-ai-integration[bot]
Copy link
Contributor

Add method to run any node with input variables

This PR adds a method to run any node upon calling, with input variables provided as JSON key-value pairs. It validates required variables and returns the execution result.

Features

  • Added method to the VM class to execute a single node with provided input variables
  • Added helper method to create nodes of different types from simplified configuration
  • Added high-level method to the Engine class for client usage
  • Implemented comprehensive unit tests for the new functionality

Implementation Details

  • The implementation is generalized to work with all node types, including triggers like blockTrigger
  • For blockTrigger, it creates a custom code node that returns the block number
  • The method respects that apContext variable contains secrets and should be read from the server-side
  • Error handling is provided for missing required variables

Testing

  • Added unit tests for different node types
  • Tested with blockTrigger to get blockNumber response
  • Verified error handling for missing variables

Link to Devin run: https://app.devin.ai/sessions/1db4b9cdbeea4d318c865f392ed87263
Requested by: Chris Li (chris@avaprotocol.org)

devin-ai-integration bot and others added 2 commits May 20, 2025 08:37
Co-Authored-By: Chris Li <chris.li.2046@gmail.com>
Formatted Go code using gofmt.
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

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.

0 participants