Skip to main content

Set up BB bots that depend on other BB bots

Many companies use a data collection process that takes many hours to complete, and then reports are updated with new data. A classic example of this would be having a daily ETL process followed by an update of data (more specific example: you run a daily data pipeline, and then extract this data into Tableau).

Example for setting upstream BB bots

A BB bot can be connected to one or more Upstream BB bot. When the current BB bot is updated through the API, it then will take into account information from its Upstream BB bots.

Set up upstream BB bots:

  1. In this example, we create two BB bots - Data pipeline and Extract

  2. Next, we set the Data Pipeline BB bot to be Upstream from the Extract BB Bot. On the Extract BB Bot page, click the Connect Upstream BB Bots button. In the Connect Upstream BB Bots window, select the Data pipeline BB bot.

    add_upstream_bb_bot.png
  3. Connect the Extract BB bot to a Hoot.

    When an API updates, the Extract BB bot and information from Upstream BB bots, such as meta[lastest_record_at] and state are used to compute the current value for the Extract BB Bot.

Let us walk through some changes and see what happens to the connected Hoot.

Success scenario

  1. After being setup, one connected Hoot has a Happy state.

  2. Let us say the Data Pipeline runs, and sets the meta[lastest_record_at] record. Nothing changes yet on the connected Hoot, because an API hasn’t updated the Downstream BB Bot yet.

  3. The extract runs and calls the API on the Extract BB bot to say that everything is Happy. Now, since there is no latest_record_at set on the Extract BB bot, it consults the Upstream BB bots to find the latest latest_record_at value, and uses this for the Hoot. The Hoot state is Happy.

Failure scenario

  1. Let us say, the next day the Data Pipeline fails. The Pipeline BB bot is Sick, but nothing changes yet on the connected Hoot because an API hasn’t updated our Downstream BB bot yet.

  2. Then the extract runs and calls the API on the Extract BB bot to say that everything is Happy. But, first it consults Upstream BB bots to find the latest state value, and uses this for the Hoot, hence making it Sick.

  3. Once the Data Pipeline BB bot turns back Happy, this will propagate with the Downstream Hoots when an API request is made to the Downstream BB bot.

Conclusion

This was a simple example using one Upstream BB bot. You can actually attach multiple Upstream BB bots and each of these can have Upstream BB bots of their own. Effectively you can have a whole graph of BB bots attached to your Hoots. If you want to get very granular, feel free to add many Upstream BB bot. But if you just need a few check points, you do not have to add these just for completeness sake. It is probably good to start small and simple, and then build up to the more complex cases as you get the hang of things.