Flow Input Block
Define inputs for your flow, enabling reusable and dynamic workflows
Overview
The Flow Input Block is a crucial component for creating dynamic and reusable flows. It allows you to define inputs that can be passed into your flow when it’s called via the SDK or used as a subflow. This flexibility enables you to create versatile workflows that can adapt to different scenarios based on the input provided.
Inputs
The default value for the input if no value is provided when the flow is called. Only available if the Use Default Value Input
setting is enabled.
Outputs
The value of the input. This will be the value provided when the flow is called, or the default value if no value is provided. The data type matches the type specified in the Editor Settings.
Editor Settings
The unique identifier for the input. This ID is used when calling the flow and defines the input’s name in the UI.
Specifies the expected data type for the input.
The default value used when no input is provided during flow execution.
When enabled, allows the default value to be provided via an input port.
The editor to use when editing this value in the UI. Make sure this matches the data type. Options:
- none: No editor
- auto: Automatically select editor based on data type
- string: String editor
- number: Number editor
- code: Code editor
- dataTypeSelector: Data type selector
- stringList: String list editor
- keyValuePair: Key-value pair editor
- toggle: Toggle switch editor
Examples
Basic Input Definition
- Add a Flow Input Block to your flow
- Set the ID to
username
and the Data Type tostring
- Set a Default Value of
"Guest"
Now, your flow has an input named username
that defaults to “Guest” if no value is provided.
Using Flow Input in a Subflow
- Create a new flow with a Flow Input Block
- Set the ID to
temperature
and the Data Type tonumber
- Add a Conditional Block that checks if the temperature is above 30°C
- Save this flow and return to your main flow
- Add a Subflow Block and select the flow you just created
- The Subflow Block will now have an input port for
temperature
This example creates a reusable subflow that can perform actions based on a temperature input.
Error Handling
The Flow Input Block will throw an error if:
- The provided input value cannot be coerced into the specified data type
- A required input is not provided and has no default value
- For array data types, undefined inputs will be converted to empty arrays
Always ensure that your input values match the expected data types to avoid runtime errors.
Best Practices
- Use descriptive IDs for your inputs to make your flows more readable
- Set appropriate default values to handle cases where inputs aren’t provided
- Consider using the
Use Default Value Input
setting for more dynamic default values - Choose an appropriate editor type that matches your data type