Using database steps in Flow Builder
Last updated
Last updated
Database steps in allow you to store a piece of data in server-less during one invocation and retrieve it during another, based on a shared key. All stored values can be deleted, too.
The Store value step configuration requires a couple of things.
Choose the exact database you want to store the value to, as you are able to have more than one. If you'd like to see all your databases, click on View your databases and it will open a separate tab with all of them listed:
If you'd like to make a database on the spot, click on Create new database. It will also open a separate tab, allowing you to do the creation:
You are required to input a key, which is the identifier for the value you’re going to store. This way you can locate it in your database.
You are also required to input a value, which is the content you are going to store in the database. It can be stored:
as a string
or a JSON formatted object
example:
Both key and value fields accept variables. If a given key already exists, this step will overwrite the value for that key.
If you want to store data for a specific user, make sure that you include a unique reference in the key, such as a phone number or contact ID. This will allow you to retrieve the value for this same user later on.
The Retrieve value from database step allows you to retrieve values that you've stored in your database.
The step configuration requires a key and a variable name:
The variable name is what the value will be stored in.
The step offers the option to read the value as JSON. If you've stored a JSON object, then enabling this option will allow you to read out properties on the output variable using the dot notation (e.g. {{outputVariable.property}}).
There is a possibility of a failed status when a record cannot be found or a JSON error occurs. To keep your Flow running smoothly, you can enable branches that will handle it:
The Delete value from database step will remove the key/value pair. This step only requires a key to be configured. As the database where we store your values is limited, you'll want to use this step in your Flow to clean up entries that you no longer need and keep your flow working smoothly.
In addition to the Flow Builder steps, we also offer a public API to interact with the database. This can be used to set/retrieve values from external systems as well as to list all key/value pairs. The API consists of the following endpoints:
GET https://flows.messagebird.com/databases/database_id
GET https://flows.messagebird.com/database-browser/
GET https://flows.messagebird.com/databases/database_id/<key>
POST https://flows.messagebird.com/databases/database_id (put key and value in the JSON body)
DELETE https://flows.messagebird.com/databases/database_id/<key>
POST https://flows.messagebird.com/databases/<database_id>/batch-delete
DELETE https://flows.messagebird.com/database-browser/<database_id>/delete-all
PUT https://flows.messagebird.com/databases/<database_id>/<key>
POST https://flows.messagebird.com/databases/database_id/count
As multiple databases are supported:
if you are calling the default database, use key-values parameter to indicate the ID.
if you are calling a specific database, use database_id parameter.
Learn all about Databases feature in the following article: .
The Store value step allows you to temporarily store values in a database that's connected to your workspace. A single database has a limited capacity (10 000 entries), so you are able to combine this step with the to clean up entries in a given database.
The key must be the same key from the .
An additional way of keeping your Database clean is making use of the of your databases.
POST <database_id>/upload
POST <database_id>/export
📤 Feel free to in case you might need some help!