Skip to content

feat(workflow): validate inputs endpoint and run-form checks (#3b) - #763

Merged
viethqb merged 4 commits into
mainfrom
feat/workflow-inputs-b
Oct 28, 2026
Merged

viethqb merged 4 commits into
mainfrom
feat/workflow-inputs-b

Conversation

@viethqb

@viethqb viethqb commented Oct 28, 2026

Copy link
Copy Markdown
Member

Summary

Roadmap package #3b, the second half of "Inputs checked at start" (#3a is #762).

  • POST /api/ws/{ws}/workflows/flows/{id}/executions/validate: JSON body { "inputs": {…} }, always 200 with Kestra's shape (id, namespace, inputs[{input, value, enabled, isDefault, errors[{message, renderError}]}], checks: []). Every declared input is listed, dependsOn-disabled ones with enabled=false. SECRET values come back as ******. Same permission and flow lookup as the start (WF_MANAGE; 404 missing/foreign/trashed, 409 disabled). Creates no execution, uploads nothing, writes no audit record. It runs the same checker with the same renderer as the start.
  • Run form: asks validate first and shows the errors beside each field; if validate fails for any reason the form goes on to the start. Start errors are attached line by line to the input they name. New client checks: min/max, after/before, SELECT/MULTISELECT membership (validator stays server-side). BackfillDialog prefilled a BOOL schedule value never ("BOOLEAN" typo); fixed.
  • Docs EN + VI (spec §8, roadmap row Phase 1a-2 — Workspace & RBAC (union permissions, group resolution, hardening) #3 done).

Divergence from Kestra: JSON body instead of multipart; a FILE is represented by its name only.

Oracle ratchet unchanged, measured: 301 / 50 / 50 / 0. Screenshots for the user docs are owed (bounds/pattern help lines, the "turned off" note, validate errors under fields); the notes for egret-data/docs are ready.

Test plan

  • validate_inputs_route 7/7, executions_routes, inputs_start, file_inputs
  • cargo test -p egret-server --lib (both drift tests), -p egret-config
  • vitest workflows (1257/1258; the one failure is the known OutputsTree flake, passes alone), tsc -b, lint, build
  • fmt, clippy -D warnings

🤖 Generated with Claude Code

viethqb and others added 4 commits October 28, 2026 11:10
POST /api/ws/{ws}/workflows/flows/{id}/executions/validate runs the
start's input check over a JSON {"inputs": {...}} body and answers 200
with Kestra's shape: every declared input (disabled ones with
enabled=false), its typed value, isDefault and errors with renderError.
SECRET values are masked. Nothing is stored, uploaded or audited.

Same gate (workflow:manage), flow lookup and 404/409 as the start; 400
for a body or inputs that is not a JSON object. The start's renderer is
shared through worker::input_outcomes, and InputOutcome gains
render_error for a dependsOn.condition or expression that fails to
render. openapi.json and the generated client are regenerated.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ting (#3b B2)

- Run calls POST .../executions/validate (generated hook) with the start's
  JSON body (a chosen file as its name) after the form's own checks; errors of
  enabled inputs the form shows go beside their field, inputs dependsOn turns
  off get a note, and a failed validate falls back to the start.
- A start refusal is split by line, each line under the input it names
  (backticks or `Missing required input:<id>`).
- Client checks add INT/FLOAT/DURATION min/max, DATETIME/DATE/TIME
  after/before (inclusive) and SELECT/MULTISELECT membership unless
  allowCustomValue; validator and bounds are shown in the help text, the
  validator is never run in the browser.
- The model's module comment now says the server checks at start and via
  validate.
- BackfillDialog prefilled BOOL via "BOOLEAN", which never matched; it now
  reads BOOL, including "true"/"false" text.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…3b B3)

Spec section 8 (EN, VI), roadmap row #3 done and the validate row supported.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@viethqb
viethqb merged commit aed0950 into main Oct 28, 2026
6 checks passed
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