
Today, we are announcing support for orchestration in Tower apps. Tower apps can now run other apps and wait for their completion before proceeding to the next steps. The run and wait primitives allow our users to implement control flows of any complexity, ranging from putting a couple of apps into a sequence to launching a bunch of apps in parallel, waiting for their completion, and doing final post-processing. To start orchestrating apps, import the following three helpers from the Tower SDK into your Tower app.
Run and Wait primitives
The run_app() helper function initiates a run of another app. The wait_for_run() and its multi-run sibling wait_for_runs() helper functions wait for the termination of runs. The run and wait primitives let you define any control flow you need. You can use the run function in loops and conditionals, creating control graph branches dynamically. You can also react to the failure of child apps differently. For example, you can rerun apps, run a different app depending on the previous run status, or log the results and move on.
For example, consider an app that needs to download recent updates to a dataset (task_app_1) and update historical stats (task_app_2). Tasks task_app_1 and task_app_2 can be done in parallel. Once both tasks are done, the app can call an AI model and run inference on new and historical data (task_app_3). This flow can be represented in the following sequence diagram.

Fan Out Example
In our example app, fan-out-ticker-runs, we download major stock indicators like open and close prices for multiple tickers. This app calls another app, write-ticker-data-to-iceberg, as many times as there are tickers in its parameters. If the parent app got “AAPL,MSFT,GOOGL” as a parameter, it will call its child app “write-ticker-data-to-iceberg” three times. All child app runs will be executed in parallel.
Next steps
Learn about the Tower SDK run and wait helpers
Sign Up for Tower Beta
Orchestrate!