-
Notifications
You must be signed in to change notification settings - Fork 18
[APO-2170] Default to entrypoint trigger when no inputs provided #3097
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
base: main
Are you sure you want to change the base?
Conversation
When a workflow has exactly one IntegrationTrigger, no ManualTrigger, and no inputs are provided, automatically instantiate the trigger with empty kwargs and use it as the entrypoint. This allows workflows with integration triggers to run without explicitly providing a trigger parameter when no trigger data is needed. Key changes: - Modified WorkflowRunner._validate_no_trigger_provided to detect single-trigger case and auto-instantiate - Added default parameter value for inputs to maintain backward compatibility - Created RoutingOnlyWorkflow test fixture for workflows that don't reference trigger attributes - Added comprehensive tests for default entrypoint behavior - Updated existing test to reflect new behavior where workflows initialize successfully but may fail during execution if they reference missing trigger attributes Workflows that reference trigger attributes will still fail at runtime with a rejected event if no trigger data is provided, maintaining safety and type correctness. Co-Authored-By: [email protected] <[email protected]>
|
@codex review |
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
There was a problem hiding this 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
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if workflow_integration_triggers: | ||
| if not self._has_manual_trigger(): | ||
| # Special case: If exactly one IntegrationTrigger and no inputs provided, | ||
| if len(workflow_integration_triggers) == 1 and inputs is None: | ||
| trigger_class = workflow_integration_triggers[0] | ||
| default_trigger = trigger_class() | ||
| self._validate_and_bind_trigger(default_trigger) | ||
| self._filter_entrypoints_for_trigger(default_trigger) | ||
| self._trigger = default_trigger |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Binding empty trigger fills state with descriptors instead of failing
The auto-trigger path instantiates a blank IntegrationTrigger and immediately calls _validate_and_bind_trigger on it. Because the instance has no attributes, BaseTrigger.bind_to_state iterates the class descriptors and writes those TriggerAttributeReference objects directly into state.meta.trigger_attributes. As a result, workflows that actually reference trigger attributes (e.g., SimpleSlackWorkflow.message) will read those descriptors and happily format strings like "SlackMessageTrigger.message" instead of raising the expected "Missing trigger attribute" error, so the workflow is marked fulfilled when it should be rejected. The new tests added in this change (test_single_trigger_with_attribute_references_still_fails) will therefore fail, and the original bug remains. Consider skipping _validate_and_bind_trigger for the default trigger or detecting missing required attributes before binding so that attribute access still raises a NodeException.
Useful? React with 👍 / 👎.
Implements automatic entrypoint trigger selection for workflows with a single IntegrationTrigger when no inputs or trigger parameter are provided. This fixes the error "Workflow has IntegrationTrigger which requires trigger parameter" when dragging an integration trigger onto the workflow graph and hitting run without configuring the trigger scenario.