FlowDefinition
FlowDefinition defines the basic structure and configuration of a flow and is one of the core concepts of the FlowEngine. It describes the flow's metadata, trigger conditions, execution steps, etc.
Type Definition
Registration Method
Property Descriptions
key
Type: string
Required: Yes
Description: The unique identifier for the flow.
It is recommended to use a consistent xxxSettings naming style, for example:
pageSettingstableSettingscardSettingsformSettingsdetailsSettingsbuttonSettingspopupSettingsdeleteSettingsdatetimeSettingsnumberSettings
This naming convention facilitates identification and maintenance, and it is recommended to be used consistently across the project.
Example:
title
Type: string
Required: No
Description: The human-readable title of the flow.
It is recommended to maintain a style consistent with the key, using Xxx settings naming, for example:
Page settingsTable settingsCard settingsForm settingsDetails settingsButton settingsPopup settingsDelete settingsDatetime settingsNumber settings
This naming convention is clearer and easier to understand, facilitating UI display and team collaboration.
Example:
manual
Type: boolean
Required: No
Default: false
Description: Whether the flow can only be executed manually.
true: The flow can only be triggered manually and will not execute automatically.false: The flow can be executed automatically (it defaults to automatic execution when theonproperty is not present).
Example:
sort
Type: number
Required: No
Default: 0
Description: The execution order of the flow. The smaller the value, the earlier it executes.
Negative numbers can be used to control the execution order of multiple flows.
Example:
on
Type: FlowEvent<TModel>
Required: No
Description: The event configuration that allows this flow to be triggered by dispatchEvent.
Used only to declare the trigger event name (string or { eventName }), does not include a handler function.
Supported event types:
'click'- Click event'submit'- Submit event'reset'- Reset event'remove'- Remove event'openView'- Open view event'dropdownOpen'- Dropdown open event'popupScroll'- Popup scroll event'search'- Search event'customRequest'- Custom request event'collapseToggle'- Collapse toggle event- Or any custom string
Example:
steps
Type: Record<string, StepDefinition<TModel>>
Required: Yes
Description: The definition of the flow's steps.
Defines all the steps contained in the flow, with each step having a unique key.
Example:
defaultParams
Type: Record<string, any> | ((ctx: FlowModelContext) => StepParam | Promise<StepParam>)
Required: No
Description: Flow-level default parameters.
When the model is instantiated (createModel), it populates the initial values for the step parameters of the "current flow". It only fills in missing values and does not overwrite existing ones. The fixed return shape is: { [stepKey]: params }
Example:

