# Dynamic Workflow Definition

**URL:** <https://discuss.circleci.com/t/dynamic-workflow-definition/34100>\
**Category:** Ecosystem\
**Tags:** android\
**Created:** [January 14, 2020, 8:44am UTC](https://discuss.circleci.com/t/dynamic-workflow-definition/34100 "2020-01-14T08:44:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dorukkangal](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/dorukkangal/32/23984_2.png) [@dorukkangal](https://discuss.circleci.com/u/dorukkangal)\
**Post date:** [January 14, 2020, 8:44am UTC](https://discuss.circleci.com/t/dynamic-workflow-definition/34100/1 "2020-01-14T08:44:41Z")

</div>

Hello,

We have a single android project from which we’re building 27 different apps. The backbone of these apps is more or less the same. Some features are different or enabled only on some of the brands, but overall the apps look very similar to each other.

I use environment variable to determine which customers to build for. Environment variable and configuration definition are as follows:

`TENANT_NAMES=‘customer1;customer2’`

```
version: 2.1
jobs:
  build_apk:
    description: "Build Apk"
    steps:
      - checkout
      - run:
          name: Assemble << parameters.tenantName >> apk
          command: |
          for TENANT_NAME in $(echo ${TENANT_NAMES} | tr ";" "\n")
          do
            ./gradlew app:assemble${TENANT_NAME}
          done

```

I want to run build process in parallel to shorten the execution time. I have done this by adiing the following lines and it works great.

```
    jobs:
      build_customer_1:
        <<: *android_config
        steps:
          - build_apk:
              tenantName: "customer1"

      build_customer_2:
        <<: *android_config
        steps:
          - build_apk:
              tenantName: "customer2"

    workflows:
      workflow:
        jobs:
          - build_customer_1
          - build_customer_2

```

In the next step, I want to define workflow dynamically according to `TENANT_NAMES`. However, I couldn’t find how to do that. Can you help me please?
