How to structure one rig with 20–30 exercise timelines without a huge state machine?

I’m building a workout player in React Native with one mascot rig that should perform many different exercises inside an app.

My use case is:

  • one reusable mascot rig

  • many exercises, potentially 20–30+

  • each exercise may have something like:

    • intro

    • rep

    • outro

  • workouts are dynamic from app code:

    • exercise X

    • reps Y

    • sets Z

    • then next exercise

  • I’m using data bindings and the React Native runtime

The goal is that the full workout runs like a smooth continuous coach/demo experience, without visible lag when switching exercises.

The challenge I’m running into is architecture:

If I model this with a single big state machine, it seems to grow very quickly:

  • exercise selection

  • intro/rep/outro per exercise

  • rep counting logic

  • transitions between exercises / states

With 20–30 exercises, this becomes a very large state machine with many transitions and conditions.

I’m currently driving the setup via data bindings using states/values like exerciseType, phase, repTarget, repDone, setTarget, and setDone.

What I’m trying to understand

Is there a recommended scalable pattern for this in Rive when using one rig for many exercises?

More specifically:

  1. Is there any good way to create something like generic intro / rep / outro states and then dynamically choose which exercise animation those states should play from code?

    • for example, some kind of placeholder / indirection pattern

    • or is every state always tied to explicit timelines, meaning each exercise has to be wired individually?

  2. Are there workarounds with maybe Blend States or Components to achieve good modular solution here?

Workarounds

One possible approach I’m considering is to orchestrate everything from code and use Rive mainly as an animation container.

In that setup, app code would handle the workout flow:

  • play intro

  • play rep N times

  • play outro

  • switch to next exercise

This feels attractive because the workout is fully data-driven, but I’m unsure whether this is a good / supported pattern with the current React Native runtime, or whether Rive is really intended to stay primarily state-machine-driven.

Main questions

  • Is there a more dynamic / modular way to structure this per exercise, without wiring every exercise manually into one big state machine?

  • Is a timelines-only approach from code valid / recommended?

  • If a state machine gets very large with many transitions and conditions, is that mainly a maintainability issue, or can it also become a real runtime performance issue?

I’d really appreciate guidance on this, as it is a very important architectural decision for the product.

Thanks a lot.