Working with Flow state data

  • How many users does our app have?
  • What is the data our users are entering?
  • What is the path our users are taking to navigate around the app?

If only there was a way we could tell how users are interacting with our apps…

Well, of course there is! Once a flow is published, we can access state data from the API tab in the Boomi Flow drawing tool. (States are running instances of a flow, by the way. State data provides information on all running states.)

Boomi Flow also has a reporting infrastructure, that lets us analyze, store, and query state data right from the comforts of our own database or analytics user interface, by posting this state object from Boomi Flow to an external endpoint hosted and managed by us internally. (However, the state data can only be accessed and is available via the API.)

The state data is available for all apps that are currently running. State data is removed three days after a state is done. Done, in Flow speak, means the app has reached a point where there are no elements left to execute in a branch/es. However, the state metadata still exists, so we can track when the app was done.

Let’s take a look now, at how we can access all this data:

  1. Click LOG IN to login to the Boomi Flow drawing tool.
  2. Click API.

    This opens the API tab, which houses an inbuilt editor. (This is convenient! We do not need a third-party tool to access the Flow API.)

    The URL field offers suggestions when we click on it.
  3. Type States in the URL field. This lists the available endpoints.

    Let’s look at them one by one.
  4. The api/admin/1/states endpoint lists all the states in a tenant, along with their State IDs. Go ahead and select the endpoint, and click GET.

    We get a green confirmation message for successful GET requests, and a red invalid request alert for requests that fail. This what the response looks like:
  5. The api/admin/1/states/{id} endpoint gives us the entire state document, so we get to see all the values added as well. This is what the GET request looks like:

    The userInteractions block inside state entries (anytime an action happens on a state, a new state entry is created), gives us valuable user insights like this user moved from Page 1 to Page 2 to Page 3 and then Page 1 again. Each of the blocks is an action that has happened in the flow.

    This data gets automatically updated, irrespective of the number of users, or the depth/breadth of their actions in the app. We can query the data using an API tool or by using the dashboard (currently under construction). We can also build our own UI for this. Now. What we are looking at here, is a single state instance for a flow. If there are 10,000 instances of a flow running, we will see 10,000 states there. If we go to the api/admin/1/states/ or the api/admin/1/states/flow/{id} endpoints, they will list all the individual states for those flows.
  6. The api/admin/1/states/flow/{id} shows all the states in a particular flow. Before we make a GET request, we will grab the Flow ID of the flow we want to track. The Flow ID is a universally unique identifier (UUID) assigned to each flow. This ID remains the same throughout the lifecycle of the flow, and is available at the bottom of the canvas.
  7.  This is what the endpoint will look like when we replace {id} with the Flow IDapi/admin/1/states/flow/3d0dc92a-bc7c-4f33-8f5d-62ef46f12d6e. We do a GET request now. This lists all the states in this particular flow:

    What are some of the things this tell us? All the information about the state! Like, for example, the current map element the state stopped on, the last person who ran it, the last time the state was modified, and so on.
  8.  We will try the api/admin/1/states/flow/{id}/{version} next. This lists all the states available in that particular version of the flow. We will be replacing {id}/{version} with the Flow Version ID. The Flow Version ID stores an unique identifier generated by the Boomi Flow engine for each version of a flow. We can find the Flow Version ID at the bottom of canvas as well.

    This is what the GET request response looks like:

Current flow developer name (the name of the flow), current map element name (the map element a user is on), date modified (the last time the state was updated by a user), and isDone (the flow has reached the last step in a branch) are especially useful if we want to understand how our apps are being used.

Also see: