Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

Flow createDefaults missing type field — save may fail server validation if type not explicitly selected #2326

Closed

Description

@akarma-synetal

Summary

Flow createFields asks for type, but createDefaults does not include a default value for type. If a user saves without selecting a type, the body may fail server validation against FlowSchema.

Root cause

In packages/app-shell/src/views/metadata-admin/anchors.ts, lines 253-267:

createFields: ['label', 'name', 'type', 'description'],
createDefaults: { nodes: [], edges: [] },

The spec's FlowSchema (spec/src/automation/flow.zod.ts, line 253) defines type: z.enum(['autolaunched', 'record_change', 'schedule', 'screen', 'api']) as non-optional. The authoritative BUILTIN_METADATA_CREATE_SEEDS correctly seeds type: 'autolaunched', but anchors.ts createDefaults is out of sync.

There is also no createSchema, so the type enum is not constrained client-side.

Steps to reproduce

  1. Create a new Flow, enter name and label
  2. Don't explicitly pick a type value
  3. Save — may fail server validation because type is missing

Expected behavior

createDefaults should include type: 'autolaunched'.

Fix

- createDefaults: { nodes: [], edges: [] },
+ createDefaults: { type: 'autolaunched', nodes: [], edges: [] },

Also optionally add a createSchema with a type enum.

Impact

Users who don't explicitly select a flow type before save may encounter a server validation error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions