Add validation to prevent inputs on trigger-based workflows during serialization#3687
Add validation to prevent inputs on trigger-based workflows during serialization#3687devin-ai-integration[bot] wants to merge 2 commits intomainfrom
Conversation
…rialization Co-Authored-By: harrison@vellum.ai <harrison.ngo719@gmail.com>
🤖 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:
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 70582907ab
ℹ️ 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".
| has_workflow_inputs = len(self.display_context.workflow_input_displays) > 0 | ||
| if has_triggers and not has_manual_trigger and has_workflow_inputs: |
There was a problem hiding this comment.
Catch mixed manual + trigger workflows with inputs
This validation only fires when no ManualTrigger is present, so a workflow that includes both a ManualTrigger and a non‑manual trigger (e.g., IntegrationTrigger) with workflow inputs will pass serialization. For non‑manual trigger executions, StateMeta skips default input population when trigger_attributes is set, so required workflow inputs will be None and any input references can fail at runtime. Because has_manual_trigger short‑circuits the check, the new validation misses this invalid configuration. Consider checking for any non‑manual trigger when inputs exist (e.g., has_non_manual_trigger) to avoid mixed‑trigger workflows silently breaking trigger executions.
Useful? React with 👍 / 👎.
…s with inputs Co-Authored-By: harrison@vellum.ai <harrison.ngo719@gmail.com>
| if has_non_manual_trigger and has_workflow_inputs: | ||
| self.display_context.add_validation_error( | ||
| WorkflowValidationError( | ||
| message="Workflows with non-manual triggers cannot have workflow inputs. " |
There was a problem hiding this comment.
[nit] would say without any Manual Triggers instead of with non-manual triggers. For instance, a workflow with a Schedule and Manual trigger has non-manual triggers but can have Workflow Inputs.
As well as capitalize Workflow wherever possible
Summary
Adds SDK-side validation during serialization to prevent workflows with non-manual triggers (IntegrationTrigger, ScheduleTrigger) from having workflow inputs defined. This complements the copilot-side change in vellum-ai/vellum-copilot#1556 which prevents the agent builder from generating inputs.py for trigger workflows.
The validation now catches:
Mixed-trigger workflows are flagged because when executed via the non-manual trigger, inputs won't be populated and can fail at runtime.
Review & Testing Checklist for Human
Notes