The Set state block is a core building block that connects information between different parts of your blueprint, interface, and code. It acts as a bridge, allowing data to flow from one part of your workflow to another - whether that’s from blueprint to interface, between different blueprint blocks, from interface back to blueprint, or to and from custom Python code.You can specify the variable name, value, and value type (plain text or JSON). The value is then available in subsequent blocks via the state variable.
Link Variable: Specify the name of the state variable to set.
Value type: Choose whether the value is plain text or JSON. The default if not specified is plain text.
Value: Enter the value to store.
The block saves the value in the specified state variable. You can reference this variable in later blocks using the state syntax, for example, @{state.variable_name}.
This example shows how to package multiple form field responses into a single state variable. It’s useful when collecting and storing related data from interface forms.Blueprint Flow:
UI Trigger → User submits a registration form. All the form fields have Link Variables set to the name of the field.
To access specific fields of the JSON data, use the state syntax, for example @{form_data.firstName} or @{form_data.address.city}.
To access elements of the state variable using Python, treat it as a dictionary. For example, @{state["form_data"]["firstName"]} or @{state["form_data"]["address"]["city"]}.
Below are the possible end states of the block call.
Name
Field
Type
Description
Success
-
success
The state was updated successfully.
Error
-
error
There was an error updating the state.
The Set state block returns the value that was set in the state variable. You can access this value in the following block as @{result}, or you can use the state syntax to access the value in the state variable, for example @{form_data}.
Was this page helpful?
Assistant
Responses are generated using AI and may contain mistakes.